mozilla / mozjpeg

Improved JPEG encoder.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cjpeg -help outdated for -quant-table and unstable default value

tbsmark86 opened this issue · comments

as of 4.0.3 cjpeg help states:

-quant-table N Use predefined quantization table N:
               - 0 JPEG Annex K
               - 1 Flat
               - 2 Custom, tuned for MS-SSIM
               - 3 ImageMagick table by N. Robidoux
               - 4 Custom, tuned for PSNR-HVS
               - 5 Table from paper by Klein, Silverstein and Carney

However https://github.com/mozilla/mozjpeg/blob/master/README-mozilla.txt list 8 tables.

More importantly the help does not mention any default but the readme states table 3.

However when calling cjpeg the used table depend on wether or not -quality is used:

  1. cjpeg some-file.pnm > some-file.jpg
    => Will use table 0 with quality 75
  2. cjpeg -quality 75 some-file.pnm > some-file.jpg
    => Will use table 3 with quality 75

This feels like a bug :)

Also the quant-table & quality value are position dependent:

  1. cjpeg -quality 70 -quant-table 3 some-file.pnm > some-file.jpg
    => Will use table 3 with quality 75 (!!!)
  2. cjpeg -quant-table 3 -quality 70 some-file.pnm > some-file.jpg
    => Will use table 3 with quality 70

This is very irritating when playing around with the settings to find the 'best' combination.
Either fix this or add a note to the documentation please.