Rodrigo schrieb:
I’ve been trying to convert a line of pixels in PNG format, into a binary file. So if the first pixel is #ffff12 it will write the first part of the filename.txt ffff12. if second pixel is #15dc3f it will write the next as 15dc3f. So if I do a hex edit of filename.txt it will show “ffff1215dc3f”. Would appreciate your help in code for this.
from PIL import Image import sys if __name__=="__main__": im = Image.open("image.png") for p in im.getdata(): sys.stdout.write("%02x%02x%02x" % p) _______________________________________________ Image-SIG maillist - Image-SIG@python.org http://mail.python.org/mailman/listinfo/image-sig