In Python, how do I easily generate an image file from some source data? -
I have some data that I would like to imagine. Each byte of the source data roughly matches the pixel value of the image.
What is the easiest way to create an image file (bitmap) using Python?
You can create a picture with a list of pixel values:
< Code> PIL import image img = Image.new ('RGB', (width, height)) img.putdata (my_list) img.save ('image.png')
Comments
Post a Comment