Joined: 10/28/2007
Posts: 1360
Location: The dark horror in the back of your mind
Looking through the changelog linked from there it looks like the only change is in one of the command line options as opposed to anything in the algorithm.
Thanks for bringing this to our attention, though.
and as for PNGGauntlet (excellent for batch optimizations), the main difference I've seen is in the user-interface bells and whistles made available by moving from .NET 2.0 to .NET 3.5
Interesting, I had heard about this tool, but didn't know it could compress better than optiPNG in some situations. I guess it's best to run both utilities to make sure images are optimized as much as possible.
Speaking of file optimizations... Has anyone used jpegoptim a little? The optimization level is surprisingly good, so much that I'd wonder if it's really lossless. Perhaps there is an image decoder than can compare two images and tell if they're exactly the same?
Hypothetically, you could convert both the uncompressed and "lossless" compressed to raw, and see if the checksums of the raw images are the same.
I guess I could test that hypothesis instead of just talking about it, but... eh. Effort. :P
I just confirmed that it's completely lossless.
Methodology:
Took initially uncompressed png and pngout'd png
converted to bmp
took md5sums of both
observed that both had the same md5sum
Build a man a fire, warm him for a day,
Set a man on fire, warm him for the rest of his life.
I learned about PNGOUT and also DeflOpt from this page: http://tasvideos.org/HowToMakePNG.html
Now I obsessively compress large batches of PNGs using PNGOUT and then run DeflOpt on them.
and I have a new obsession: doing the same with JPGs (using the lossless method of rejiggering the Huffman tables in jpegoptim)
One thing that you can sometimes try is to reduce the amount of colors in the image to 256 (or sometimes even less). With some images, such as GUI screenshots and such, 256 colors is completely sufficient to convey what you want to show, and it can make the png file significantly smaller.
In fact, I do this so often that I have actually made a zsh function which automatizes the whole process (reduces the amount of colors and then runs optipng and pngout on the result). It might work on other shells as well:
reducecolors () {
if [ "$2" = "" ]
then
echo "Usage: reducecolors <infile> <outfile> [<colors>]"
else
if [ "$3" = "" ]
then
echo "Reducing $1 to $2 with 256 colors..."
convert -colors 256 +dither "$1" "$2"
else
echo "Reducing $1 to $2 with $3 colors..."
convert -colors "$3" +dither "$1" "$2"
fi
if [ $? = 0 ]
then
echo "optipng..."
optipng -o 7 -q "$2"
echo "pngout..."
pngout -q "$2"
fi
fi
}
(Note that it turns dithering off when reducing the amount of colors because dithering really kills compression ratios, and with most of the intended images dithering is unneeded.)