Some musings about image compression

JPEG chromatic subsampling is a bad idea

They say that the human eye has less resolution for chromatic information than it has for brightness information. For this reason, less resolution was allocated for colour in several kinds of image formats. An example is TV, which allocates less bandwidth for colour. Another example is JPEG.

In the case of JPEG, I think the algorithm they use is a bad idea. What they do is store less samples for colour information, which is called chromatic subsampling. Typically used is one sample per 2x1 or 2x2 block of pixels. However, this results in the colours becoming visibly duller when they are reconstructed, especially in high-detail areas. This was a problem I already noted with JPEG compression, but I didn't know that the chromatic subsampling was to blame, and tried to remedy the problem by increasing the jpeg quality to very high levels, which only helps so much.

Luckily, you can turn it off, which results in images that are about 30% larger (depending on the level of detail, in some cases an image might get twice as large), but which look much better. Not all software is capable of tweaking the subsampling factors, but gimp and pnmtojpeg can do it.

Left: pnmtojpeg (2x2 samples). Right: pnmtojpeg --sample 1x1. Note that especially the reds are less vivid in the subsampled image.