[wplug] jpg vs png

jsbillings at mac.com jsbillings at mac.com
Fri Jan 10 16:58:52 EST 2003


JPEG uses lossy compression, while PNG uses lossless compression.  If
you are unfamiliar with what those are, Lossless compression a method of
encoding information so it takes up less space, but when decoded, is
exactly the same information as before encoding.  Lossy compression, on
the other hand, will discard some information to make it smaller, so
there is no way to return it back to it's original state.  

A typical photo image is most likely going to compress better with JPEG
than PNG, because JPEG has been optimised for photorealistic images.

On Tue, 2003-01-07 at 17:01, Alexandros Papadopoulos wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hi()
> 
> I recently processed a batch of JPEG images (~150) for my site, 
> shrinking them to the desired size, creating thumbnails etc. I also 
> wanted to convert them all to PNG format, because of licensing issues 
> with JPEGs (http://www.burnalljpegs.org), and as a token of support for 
> this truly free format (http://www.libpng.org/pub/png).
> 
> The problem is, the file sizes I'm getting are not satisfactory. JPEGs 
> seem to compress a lot better than PNGs. (the fact that it's lossy does 
> not bother me, we're just talking about web pictures here).
> 
> I did the batch conversion with the program convert(1), using the 
> following script:
> - -----------------------------------------------------------------------------
> #! /bin/bash
> #converts all images in directory to 800x600 png's.
> 
> for file in *.jpg
> do
> convert $file -size 800x600 -resize 800x600 -quality 9 $file.png
> rm -f $file
> mv $file.png `echo $file.png | cut -d '.' -f 1,3`
> done
> 
> #creates thumbnails and puts them to ../small/
> 
> for file in *.png
> do
> convert $file -size 800x600 -resize 240x250 -quality 9 $file.small
> #rm -f $file
> mv $file.small ../small/`echo $file.small | cut -d '.' -f 1`_small.png
> done
> - ---------------------------------------------------------------------------
> 
> The original JPEGs were 1600x1200, and about 600-700K each. The 
> resulting PNGs were 800x600, and still about 600K each! When I 
> converted the 800x600 images to JPEGs, I got excellent results, with 
> file sizes ~100-200K.
> 
> I tried using the GIMP to manually do the conversion, but the results 
> were the same. JPEGs were less than 50% the size of the respective 
> PNGs.
> 
> Is this normal, or am I doing something wrong here?
> 
> Thanks
> 
> - -A
> - -- 
> http://andrew.cmu.edu/~apapadop/pub_key.asc
> 3DAD 8435 DB52 F17B 640F  D78C 8260 0CC1 0B75 8265
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.1 (GNU/Linux)
> 
> iD8DBQE+G04xgmAMwQt1gmURAv4pAJsHweBW60MGSnHydMi367ZC2Zwr5wCePjTl
> y2vCZ0K136KiHeEsHHfMupQ=
> =xOQR
> -----END PGP SIGNATURE-----
> 
> _______________________________________________
> wplug mailing list
> wplug at wplug.org
> http://www.wplug.org/mailman/listinfo/wplug
-- 
Jonathan S Billings <jsbillings at mac.com>



More information about the wplug mailing list