[Image-SIG] help wanted: new GIF encoder needs testing!

Fredrik Lundh fredrik@pythonware.com
Tue, 9 Feb 1999 12:15:27 +0100


By some odd reason, I wrote a PCX encoder for PIL this
weekend.  While PCX uses a simple run-length encoding
scheme, it still produced files that were much smaller
than the "uncompressed by legal reasons" GIF files you
get from the current version of PIL.

Anyway, when my good friend the Mad Scientist heard
about this, he asked me why I didn't use run-length
encoding also for the GIF files (while run-length en-
coding often gives smaller files, it's not even remotely
similar to LZW).

 After some experimentation, I've managed to write a new
GIF encoder which uses run-length encoding (this wasn't
entirely trivial ;-).  this gives files that are typically 30%-50%
of the size generated by earlier versions (ranging from
exactly the same size as before, down to files that are
actually smaller than the corresponding GIF files...)

But I need your help in testing this on a larger sample
of GIF files and GIF readers.  If you have some time to
spare, and a PIL 1.0b1 build within reach, you can grab
the "patch" from:

    http://www.pythonware.com/madscientist/gif-990208.zip

replace libImaging/Gif.h and libImaging/GifEncode.c with
the versions in this file, and rebuild.  You can then use
the checkgif.py script on a bunch of existing GIF files to
make sure it works on your data.

If you have some extra time to spare, you could also try
loading GIF files generated by this encoder with whatever
GIF-reading software you have.

Report your findings to me or to this list.  If I don't hear
anything at all, or if I only hear positive things, this will
go into the next release.

Cheers /F
http://www.pythonware.com/people/fredrik