JPG - PNG conversion problem

Jason Harper JasonHarper at pobox.com
Mon Jan 26 21:59:47 EST 2004


"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



More information about the Python-list mailing list