Python - How to save a list as an image? -
i generate regular list. possible save list jpeg image or png or whatever can open image , @ it? trying figure out using python imaging library (pil).
here 1 of possible solutions:
create empty image object using: image.new(mode, size, color)
modify image object contain data "list"
save 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')
Comments
Post a Comment