[PYTHON IMAGE-SIG] Save a 5 bit gif as a 5 bit gif?
Fredrik Lundh" <email@example.com
Tue, 10 Jun 1997 12:22:54 +0200
>When I save this smaller image as a GIF, PIL seems to default to using =
>8-bit palette (filling the remaining space with shades of grey) which =
>the side effect of making the smaller image about 55k - almost as big =
>the original. As a 5-bit image, the gif is more like 15k. However, I =
>cannot find any obvious way of setting the bit depth that I want for =
The problem here is not really the bitdepth, it's the LZW patentl...
Since reaching an agreement with Unisys turned out to be
impossible (it would have meant me *and* the PIL users
paying them for each *instance* of PIL being in use, and
also me keeping a registry of all PIL users; they also consider
all correspondence on the matter as being their property ;-),
I instead added a mechanism to write "uncompressed" GIF
files. Such files can still be read by any LZW decoder, but are,
as you noted, very large. And using this technique only works
well with 8-bit images...
If you're on a unix platform, you can change the GifImagePlugin
to use NetPBM instead (see comments in the file for details).
Otherwise, I have no good ideas (if Netscape had cared, we'd
all be using PNG instead by now...)
IMAGE-SIG - SIG on Image Processing with Python
send messages to: firstname.lastname@example.org
administrivia to: email@example.com