This new luma quantization table is obtained from the standard luma quantization table as follows:

First, symmetrize, that is, replace the entry at position (i,j) by the average of the standard entry at the same position and the standard entry at position (j,i), rounding down.

Then, make the result monotone, that is, fix things so that a higher frequency mode never has a smaller entry than a lower frequency mode. Specifically, this means that the list of entries should be nondecreasing both column wise and row wise.

With this quantization table, you can expect files about 1% smaller (this is highly dependent on the image content as well as its dimensions) with an equivalent quality.

In following posts, I'll explain the heuristics behind this modification, as well as give code that allows use this customized quantization table with JPEG Group's cjpeg as well as ImageMagick's convert (I am told ImageMagick will be able to use custom qtables soon).

As of now, I issue a

Challenge: Show me a noncontrived image for which the standard luma qtable gives a smaller file with as good or better image quality than the above new one.

The noncontrived clause has to do with that someone who understands JPEG compression can construct an image specifically to make the standard table win.

Note that recompressing a very low quality JPEG image and similar endeavors does not really count as a proper response to the challenge. So is recompressing a JPEG produced with the standard table at essentially the same quality level, using unreasonable quality levels, and other splitting hair tasks.

Being smaller by a trivial amount does not really count either.

This challenge has to do with a reasonable "real world" case.

(To those who followed my attempts at improving qtables: The above new luma one is most likely the best I have come up with for all purpose use. I don't think I'll be able to put together a qtable which is significantly better for all purpose use. Exploiting progressive encoding is another story.)

Last edited by NicolasRobidoux on 2012-03-03T14:33:23-07:00, edited 9 times in total.