Python - How To Save A List As An Image?
I generate a regular list. Is it possible to save this list as a JPEG image or PNG or whatever so that I can open the image and look at it? I am currently trying to figure it out u
Here is one of the possible solutions:
Create an empty image object using: Image.new(mode, size, color)
Modify the image object to contain the data from the "list"
Save the image
E.g.:
new_img = Image.new("L", (NEW_X_SIZE, NEW_Y_SIZE), "white")
new_img.putdata(new_img_list)
new_img.save('out.tif')
Post a Comment for "Python - How To Save A List As An Image?"