[Image-SIG] (no subject)

Tom Blackmore tom.blackmore at arctictiger.se
Tue May 18 09:18:19 CEST 2010


Hi.

I'm new to the PIL library and having problems while converting 24
bits png to gif. While the conversion works fine from an image quality
perspective, the resultant gif image size is very large. Much larger
than the original 24 bit png! Carrying out the same conversion in
other image programs (irfanview, gimp) produces an image of about a
quarter of the size as my code.

I use the following code to carry out the conversion.

img = Image.open(self.input)
img = img.convert('RGB').convert('P', palette=Image.ADAPTIVE)
img.save(self.output,"gif")

I use an adaptive palette since I'm converting maps and dithering
reduces the quality.

Any tips/suggestions are welcome.

Kind regards

Tom

-- 
Tom Blackmore
www.arctictiger.se

Västerkvarnsvägen 7,
73493 Kolbäck
Tfn. 073-8413456


More information about the Image-SIG mailing list