JPEG -quality & -sampling-factor
Posted: 2013-05-28T02:57:45-07:00
http://www.imagemagick.org/script/comma ... hp#quality
When the quality is greater than 90, then the chroma channels are not downsampled.
http://www.imagemagick.org/Usage/formats/#jpg_write
However when "quality" is 90 or higher, the channels are not sub-sampled.
The documentation does not make clear that -quality does reset -sampling-factor if it has been set previously. This is least clear when it is set implicitly by an input image. Here the sampling factor is determined by in.jpg, not -quality:
convert in.jpg -quality ## out.jpg
For images not in Y'CBCR, this is a huge problem. Here out.jpg is blurry:
convert wizard: in.jpg
convert in.jpg -colorspace CMYK out.jpg
For a user who hasn't set -quality and has never used -sampling-factor, this resulting blur is difficult to understand.
Bug or documentation issue, let me know and I'll respond to these users appropriately. These two forum topics brought this issue to attention:
bizarre drop in quality on no-op convert on small JPEG - by bugbear
viewtopic.php?f=1&t=21934&p=93593
RGB JPEG to CMYK JEPEG looks much too dark and blurry - by dschroeder
viewtopic.php?f=1&t=23474
ImageMagick 6.8.5-6 2013-05-10 Q16 on Windows 7
When the quality is greater than 90, then the chroma channels are not downsampled.
http://www.imagemagick.org/Usage/formats/#jpg_write
However when "quality" is 90 or higher, the channels are not sub-sampled.
The documentation does not make clear that -quality does reset -sampling-factor if it has been set previously. This is least clear when it is set implicitly by an input image. Here the sampling factor is determined by in.jpg, not -quality:
convert in.jpg -quality ## out.jpg
For images not in Y'CBCR, this is a huge problem. Here out.jpg is blurry:
convert wizard: in.jpg
convert in.jpg -colorspace CMYK out.jpg
For a user who hasn't set -quality and has never used -sampling-factor, this resulting blur is difficult to understand.
Bug or documentation issue, let me know and I'll respond to these users appropriately. These two forum topics brought this issue to attention:
bizarre drop in quality on no-op convert on small JPEG - by bugbear
viewtopic.php?f=1&t=21934&p=93593
RGB JPEG to CMYK JEPEG looks much too dark and blurry - by dschroeder
viewtopic.php?f=1&t=23474
ImageMagick 6.8.5-6 2013-05-10 Q16 on Windows 7