Hacker News new | ask | show | jobs
by frederickcook 5906 days ago
>> If your image is a photo or something photo-like, you should use JPG.

Keep in mind that many, many things produced by computers these days are photo-like, as the OP demonstrated with the icons, so this might not be the best rule of thumb. No argument that simple images should be PNG, but toss in a couple of gradients (which your HN screenshot does not have) and your PNG can start to blow up.

1 comments

PNG is extremely good at compressing certain kinds of gradients.

Linear gradients get compressed nearly as well as large areas of flat color. More complicated images, of course, are more difficult to optimize.

Basically, you cannot typically create PNG-optimized graphics automatically (yet). There are a lot of things you can do pre-save to help the compression techniques (and when they won't work, use another format and stitch the two together - at the cost of another HTTP request).

http://www.smashingmagazine.com/2009/07/15/clever-png-optimi... is a pretty good outline of it.