JPG - PNG conversion problem

Raaijmakers, Vincent (GE Infrastructure) Vincent.Raaijmakers at ge.com
Tue Jan 27 08:42:41 EST 2004


I agree with all te comments that I got regarding the expected growth of my file size in PNG.

However, when I use Gimp in Linux, the PNG conversion (using default settings) on the same picture, the file size grows form 14k (JPG) to 18k (PNG). Using PythonMagick it grows to 64k!!

So, why is Gimp more efficient in the conversion?
I must be doing something different. 

Today I will try to use some Java imaging libraries to see how efficient they are. A growth from 14k to 64k is unacceptable. We are talking about a picture with a size of 160x120.

For now, what tips and tricks are available to reduce my output file size using Magick?
Tried to work with filtering and quality settings, no huge results so far.

Vincent

-----Original Message-----
From: python-list-bounces+vincent.raaijmakers=ge.com at python.org
[mailto:python-list-bounces+vincent.raaijmakers=ge.com at python.org]On
Behalf Of Jason Harper
Sent: Monday, January 26, 2004 10:00 PM
To: python-list at python.org
Subject: Re: JPG - PNG conversion problem


"Raaijmakers, Vincent (GE Infrastructure)" wrote:
> Who can explain the huge increase in size when I convert a JPG into a PNG format using PythonMagick:
> I read the JPG from a video server and has a resolution of 352x240, size is about 15k
> After my PNG conversion and resizing the resolution to 160*120, the size is 64k!!

JPEG is a lossy compression format (well, normally - there are some
obscure exceptions to this).  It throws away subtle details (details
that the human eye is relatively insensitive to) in order to achieve its
high compression ratios.

PNG uses only lossless compression.  You are guaranteed that the image
you get out will be pixel-for-pixel identical to the image you put in. 
Unfortunately, this greatly limits the possibilities for compression -
in fact, no lossless compressor can guarantee ANY reduction in file size
over all possible inputs.

Basically, converting a lossy to a lossless format gives you worst of
both worlds - the loss of detail of one, and the large file size of the other.
	Jason Harper
-- 
http://mail.python.org/mailman/listinfo/python-list




More information about the Python-list mailing list