GIF89A and PIL

Gabriel Genellina gagsl-py2 at
Tue Mar 30 06:00:16 CEST 2010

En Mon, 29 Mar 2010 04:41:23 -0300, Gregory Ewing  
<greg.ewing at> 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.

Fredrik Lundh, in

"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