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 using the python imaging library (PIL).
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')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With