[Image-SIG] Re: GIF problems
Fredrik Lundh
fredrik@pythonware.com
Thu, 10 Dec 1998 19:16:15 +0100
David Ascher wrote:
>What's the way to save a P mode image in a GIF-encoded string. If I try:
>
> i.tostring('GIF')
if you want an entire GIF file, the right way
to do it is:
fp = StringIO.StringIO()
i.save(fp, "GIF")
data = fp.getvalue()
but assuming you already knew that, and really
want to run the gif encoder (which produces
uncompressed LWZ data, but no headers), you
could try something like:
data = i.tostring("gif", i.mode)
Cheers /F
fredrik@pythonware.com
http://www.pythonware.com