python png as numpy array code example
Example 1: open image in numpy
image = PIL.Image.open(pathToImage)
frame = numpy.asarray(image)
Example 2: pil image from numpy
from PIL import Image
PIL_image = Image.fromarray(numpy_image.astype('uint8'), 'RGB')