ndarray to pil image

55

ndarray to pil image -

from PIL import Image
image_from_array = Image.fromarray(nd_array)

pil image from numpy -

from PIL import Image

PIL_image = Image.fromarray(numpy_image.astype('uint8'), 'RGB')

pil image to numpy -

>>> pix = numpy.array(pic)

Comments

Submit
0 Comments