How to Make PNG Images Small for the Web
First, make sure you want PNG. Rule of thumb: JPEG for photos, PNG for graphics.
2 things I do:
Shrink the palette. PNGs usually have room for 224 colors, or 232 including a transparency/opacity channel. If you’re using 256 or fewer colors, you can save your image with an indexed palette, which uses 1 byte for each pixel, before compression. In the free graphics program GIMP, you do this in Image → Mode → Indexed… → Generate optimum palette. Photoshop can do it too, and I’m sure any other good graphics program can. Before you go off saving in 1-bit mode, keep in mind that with antialiasing, there may be more colors than you can count. Savings are in the 75% range.
Compress more. To not be painfully slow, graphics programs use some heuristics to get good, but not totally optimized compression on PNGs. Once you’ve saved your final PNG, and can spare the minute or so, you can use programs like pngcrush or optipng to try to increase compression. I do
optipng -o7 mypicture.pngfor maximum compression. With files saved in the GIMP, I usually get 0-2% off, but I’ve gotten 20% or more off for other PNGs.
That’s it, 2 steps to prep PNGs.