I am doing some image processing on images. I use PIL to resize the images.
The image in question is a multilayered TIFF image. When I run it through my code, all I get is an image with a green background and no detail. It is as if the image is being corrupted, or not being read correctly by PIL. I have got the repro case down to a few lines of python code. -- import os import sys import Image import ImageFile import StringIO data = None with open(sys.argv[1]) as fp: data = fp.read() img = Image.open(StringIO.StringIO(data)) print img.format, img.size, img.mode, img.getbands() #img.show() img1 = img.convert("RGB") print img1.format, img1.size, img1.mode, img1.getbands() #img1.show() out = StringIO.StringIO() img1.save (out, "JPEG" , quality=95) with open(sys.argv[2], 'w') as f: f.write(out.getvalue()) -- At each step if you comment out the img.show() I get an image with a green background, and no detail I pass in <inputfile> <outputfile> as arguments to this tool Here is the source image URL: http://feroze.s3.amazonaws.com/ptiff_file.jpg Any idea what I am doing wrong? Thanks, feroze.
_______________________________________________ Image-SIG maillist - Image-SIG@python.org http://mail.python.org/mailman/listinfo/image-sig