[wplug] jpg vs png

Alexandros Papadopoulos apapadop at cmu.edu
Tue Jan 7 17:01:21 EST 2003


-----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-----




More information about the wplug mailing list