Answers for "load numpy array to image pil"

9

ndarray to pil image

from PIL import Image
image_from_array = Image.fromarray(nd_array)
Posted by: Guest on July-28-2020
2

pil image from numpy

from PIL import Image

PIL_image = Image.fromarray(numpy_image.astype('uint8'), 'RGB')
Posted by: Guest on October-04-2020
4

pil image to numpy

>>> pix = numpy.array(pic)
Posted by: Guest on June-17-2020
0

save numpy arrayw with PIL

from PIL import Image
im = Image.fromarray(A)
im.save("your_file.jpeg")
Posted by: Guest on April-18-2021

Python Answers by Framework

Browse Popular Code Answers by Language