Optimize Image File Sizes 1
If you want smaller image file sizes at the same resolution, but files that still display nice. Check out the ImageMagick tool convert.
The size reductions can easily be 50% to 90% without a noticeable loss in quality.
This script worked nicely
#!/bin/sh
for filename in “$@”; do
convert -quality 20 $filename $filename.opt.png
done
on a test file here – the 1.3MB input file became 208KB output. I can’t tell the difference. I was shocked that “20” quality was so good. Normally, I use 80 for JPG saves. Not anymore! Time to run that script through my entire web image directory!
After running a few image file through, some files had artifacts at any level below 95 and actually increased in size. This was for files that were already pretty small and already in PNG format, thumbnails. Switching from PNG to JPG for these files, even with quality set to 95 resulted in 50% smaller files. Going from an 8KB .PNG to a 4KB .JPG could make your web-app almost 50% quicker. Size matters.
I tried a 10.7MB input file (panorama) and had to bump up the quality to 40 for acceptable output. The output file size became 900KB. Not bad for a 9350×1766 image.
I completed the conversion of the images on this website using the convert tool today.
Not all images were compressible. Here’s what I learned:
See the Fort Collins article for those photos which have been re-compressed. Nice enough for the web, I think.