Png24 to GIF image size
Tom Blackmore <[email protected]>
| Newsgroups | gmane.comp.python.image |
|---|---|
| Message-ID | <[email protected]> |
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
_______________________________________________
Image-SIG maillist - [email protected]
http://mail.python.org/mailman/listinfo/image-sig
C00000004.png
(image/png, 13.3 KB) - not displayed
test_java.gif
(image/gif, 6.3 KB) - not displayed
test_pil.gif
(image/gif, 16.2 KB) - not displayed