GIF89A and PIL

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Tue Mar 30 00:00:16 EDT 2010


En Mon, 29 Mar 2010 04:41:23 -0300, Gregory Ewing  
<greg.ewing at canterbury.ac.nz> escribió:
> Stephen Hansen wrote:
>
>> So I wonder if there's just some hyper-optimization Photoshop does that  
>> PIL can't round-trip.
>
> You may find that PIL isn't bothering to compress at all,
> or only doing it in a very simpleminded way.

Indeed.
Fredrik Lundh, in  
http://mail.python.org/pipermail/image-sig/1998-July/000506.html

"When writing GIF files, PIL uses a simpleminded encoding that, by some
odd reason, LZW decoders have no trouble reading.  To write compressed
GIF files, there are a number of options:

     -- install NETPBM, and hack GifImagePlugin so it uses _save_ppm instead
        of _save (just remove "_ppm" from the latter).
     -- write an _imaging_gif module that takes a PIL image and writes
        a GIF version of it.  how you implement that is up to you..."

After twelve years the above comments are still applicable.

-- 
Gabriel Genellina




More information about the Python-list mailing list