Page 1 of 1

Bad JPEG CMYK subsampling

Posted: 2013-02-03T15:00:40-07:00
by Jason S
(This is probably the same issue observed in this thread.)

Using IM 6.8.2-3 to convert a subsampled (YCbCr) JPEG to CMYK, I get a raw-CMYK JPEG with all channels except the Cyan channel subsampled. That's kind of a silly thing to do, and makes most images pretty blurry.

Code: Select all

$ convert logo: -quality 80 1.jpg
$ convert 1.jpg -colorspace CMYK 2.jpg

$ identify -verbose 1.jpg|grep sampling
    jpeg:sampling-factor: 2x2,1x1,1x1

$ identify -verbose 2.jpg|grep sampling
    jpeg:sampling-factor: 2x2,1x1,1x1,1x1
Raw-CMYK JPEGs should never be subsampled. But IM probably shouldn't write raw-CMYK by default anyway. It should encode it as YCCK, which I think is okay to subsample. I think that can be done by adding the following after "jpeg_set_defaults" in coders/jpeg.c:

Code: Select all

  if (jpeg_info.in_color_space == JCS_CMYK) {
Note: To tell YCCK from CMYK, look at the "color transform" field of the APP14 "Adobe" segment (identify won't tell you).

Re: Bad JPEG CMYK subsampling

Posted: 2013-02-03T15:41:32-07:00
by magick
We thought libJPEG does the conversion automatically from CMYK to YCCK. However, we'll add the patch and research / test before the next point release.

Re: Bad JPEG CMYK subsampling

Posted: 2013-05-17T08:07:58-07:00
by rgpublic
Argh. Stop the presses! I used the wrong server and mixed up versions. It definitely works with the most recent version and the above mentioned patch is included with the source. This just for the record here. Sorry for the confusion. Magician, you can continue with your daily routine...

Dear magick, I've got the same problem as the OP. My JPEGs also come out blurred. Is there any update on this? I just downloaded and tried version 6.8.5-6 to no avail. Should this bug be fixed in that version? TIA for clarification