Hi All,

I'm having problems converting a png24 to a gif image. The conversion works,
it's just the gif file is very large.

The example C00000004.png is 14k. When I convert it to a gif with pil the
file is 17k (test_pil.gif). If I use a Java library the gif is only 7k (
test_java.gif). I've got about 10000000 images to process so this is quite a
big deal.

I've enclosed an example of a png that I'm trying to convert C00000004.png
and the result from my conversion with PIL (test_pil.gif) and the result
from Java conversion test_java.pil.

The Python code I'm using:

im = Image.open(path + 'C00000004.png')
im = im.convert('RGB').convert('P', palette=Image.ADAPTIVE)
im.save(path + 'test.gif','gif')

In the Java version I'm using ImageIO like this.

ImageIO.write(img, "gif", outputfile);

 Am I missing something?

Thanks in advance for any help.

Kind regards

Tom

<<attachment: C00000004.png>>

<<attachment: test_java.gif>>

<<attachment: test_pil.gif>>

_______________________________________________
Image-SIG maillist  -  Image-SIG@python.org
http://mail.python.org/mailman/listinfo/image-sig

Reply via email to