JPG - PNG conversion problem

Dietrich Epp dietrich at zdome.net
Sun Feb 1 21:54:45 CET 2004


On Feb 1, 2004, at 11:18 AM, Frantisek Fuka wrote:

> Mark Borgerding wrote:
>> 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!!
>> Is the output png a color palette image?  See if you can get 
>> acceptable results by limiting the color palette to 256 colors or so.
>
> The problem (although it's hard to call this "problem") is that PNG is 
> losless format, whereas JPG is not. What you are doing is akin to 
> converting JPGs to BMP or TIF.

Er, BMP is uncompressed, PNG is compressed losslessly, TIFF can be 
compressed a few different ways.  Many TIFFs contain JPEG-compressed 
data (which is why TIFF is such a cool format).





More information about the Python-list mailing list