top | item 6958729

Advanced Image Optimization Tricks

68 points| jggube | 12 years ago |sixrevisions.com

20 comments

order

xfs|12 years ago

Gaussian Blur JPEG Optimization

Blurring reduces noise/entropy so that JPEG compresses better. You can use a bilateral filter (Photoshop: Surface Blur; GIMP: Selective Gaussian Blur) for larger amount of smoothing while preserving edges.

Image Posterization

This is actually called image quantization. pngquant[1] and pngnq[2] are two specialized open-source tools for automatically selecting the best palettes to represent the image with least perceptual error.

Selective JPEG Compression

JPEGmini[3] automatically selects areas of interest with custom perceptual metrics and preserves quality within those areas while optimizing out other areas. I tested the sample image in the article: JPEGmini obtained 6.7% decrease in size without manually selecting the mask.

[1]: http://pngquant.org/

[2]: http://pngnq.sourceforge.net/

[3]: http://www.jpegmini.com/main/shrink_photo https://news.ycombinator.com/item?id=2940505

jbri|12 years ago

Given that these techniques seem to be well-known, it would be interesting to see a JPEG compressor which uses what we know of human vision to minimize filesize while keeping the image visually the same.

JPEGmini seems to go partway with selective compression, but it seems like there's room to improve the actual compression algorithm to do things like gaussian smoothing instead of just truncating the high-frequency components to reduce filesize.

brissmyr|12 years ago

"Selective JPEG Compression" was a new one for me.

For PNG, always run your images through ImageOptim (http://imageoptim.com) before committing your work.

And for large PNGs, ImageAlpha (http://pngmini.com) lets you reduce bit depth, keep transparency and maintain a decent image quality.

markdown|12 years ago

> For PNG, always run your images through ImageOptim

Why only PNG?

lyndonh|12 years ago

OK, interesting article and some quite effective tricks but this is not "optimization". Optimization means getting the best possible result from something, by some criterion. For example, blurring an image and then getting a bit better compression is not optimal. But if it could be shown that was getting the best possible compression for JPEG then it would be optimal.

The article should be called "Image Compression Tricks". I don't think any of the techniques are considered advanced in today's technology.

rebel|12 years ago

The example images they use are the ideal use cases for each of these techniques. The rocks photo has no hard edges. Wood texture by nature is similar to what posterization does. These tricks won't help in many cases. Although if you do happen to have something that fits the criteria, these should be quite useful.