[Image-SIG] PIL - Tiff problems

Laura & Edward Cannon cannon.el at gmail.com
Mon May 4 20:28:24 CEST 2009


You don't need to convert to mode P for png, and that might be some of the
issue. PNG supports mode L.

On Mon, May 4, 2009 at 10:44 AM, Andrew <agagne at genome.med.harvard.edu>wrote:

> In reality the tif will be ~7 mb, but i was able to use pil to shrink the
> image size. The problem comes with converting to a png.
>
> I open the tif then call
>
> im = im.convert("L")
> im = im.convert("P")
> im.save("C:\\test\\test2.png","PNG")
>
> To view the tif, I would generally use irfanview.
>
> thanks,
> andrew
>
>
> Fredrik Lundh wrote:
>
>> On Mon, May 4, 2009 at 4:08 PM, Andrew <agagne at genome.med.harvard.edu>
>> wrote:
>>
>>
>>> I've been having a problem with my tiff. When converting to a PNG or a
>>> JPEG
>>> the colors get messed up (black becomes white). I belive it has todo with
>>> the tiff being little endian. I noticed that in 1.1.7 the following was
>>> added to the change log.
>>>
>>>  Added limited support for I;16L mode (explicit little endian).
>>>
>>> Would someone be able to assist me in utilizing this? I've installed
>>> 1.1.7
>>> but am unsure of how to utilize this feature.
>>>
>>>
>>
>> Can you provide a sample in some way??  (you can mail it directly to
>> me if you don't want everyone to have access to the file; I never
>> redistribute sample files without permission).
>>
>> </F>
>>
>>
>
> _______________________________________________
> Image-SIG maillist  -  Image-SIG at python.org
> http://mail.python.org/mailman/listinfo/image-sig
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/image-sig/attachments/20090504/894d8666/attachment.htm>


More information about the Image-SIG mailing list