Page 1 of 1

Color mismatch converting YCCK Jpeg to sRGB colorspace

Posted: 2014-11-07T14:22:27-07:00
by chrisrose708
Hey,

We're having an off-color issue when converting a YCCK JPEG to sRGB colorspace. The JPEG also has an embedded CMYK profile.
Here is an example image:
Image

The cloud area on the image is blue-ish (when viewed from a program like Gimp or MS Paint), but after converting it turns green-ish.

Here is the convert command we're running:
convert input.jpg -limit thread 1 -resize 1024.0x768.0 -quality 89 -colorspace sRGB -auto-orient -strip out.jpg

We found some useful metadata on the image using this online tool: http://regex.info/exif.cgi

According to this thread, http://www.imagemagick.com/discourse-se ... 2&p=116316), it sounds like ImageMagick 6.8.9-10 will support these sort of conversions now.

Any advice on this?

Thanks!
Chris

Re: Color mismatch converting YCCK Jpeg to sRGB colorspace

Posted: 2014-11-07T15:09:35-07:00
by snibgo
When a file contains a profile, it is unwise to ignore it. Better is to convert it to sRGB. Then you can ignore the profile, eg by stripping it:

Code: Select all

convert KW3Snub.jpg -profile sRGB.icc -strip r.png
This seems to work, in v6.8.9-5. Perhaps in 6.8.9-10 a "-colorspace sRGB" would work.

Re: Color mismatch converting YCCK Jpeg to sRGB colorspace

Posted: 2014-11-07T16:29:42-07:00
by dlemstra
The YCCK color conversion was only added to the tiff reader in 6.8.9-10. I will try to see if I can also add it to the jpeg reader.

Re: Color mismatch converting YCCK Jpeg to sRGB colorspace

Posted: 2014-11-08T16:10:10-07:00
by dlemstra
It turns out the color is green CMYK (85%, 0%, 31%, 0%) and it is already corrected by the jpeg library.

Re: Color mismatch converting YCCK Jpeg to sRGB colorspace

Posted: 2014-11-20T08:45:16-07:00
by chrisrose708
I don't think the original color is green CMYK. Here's a picture of the image viewed in GIMP:

Image

The top is the original image (blue-ish), and the bottom is the converted image after running the following convert command:
convert KW3Snub.jpg -colorspace sRGB -strip out.jpg

This is tested with ImageMagick 6.8.9-10.

Re: Color mismatch converting YCCK Jpeg to sRGB colorspace

Posted: 2014-11-20T09:02:28-07:00
by dlemstra
The top is showing RGB instead of CMYK so I am not sure if you should trust the result. Fred checked the color in Photoshop and it was: CMYK (85%, 0%, 31%, 0%) which is 'greenish'.

Re: Color mismatch converting YCCK Jpeg to sRGB colorspace

Posted: 2014-11-20T10:56:05-07:00
by fmw42
You can see the color by

Code: Select all

convert -size 100x100 xc:"CMYK (85%,0%,31%,0%)" swatch.png
This matches the second picture. But if you want better color representation from CMYK to sRGB, then use profiles rather than -colorspace.

Code: Select all

convert KW3Snub.jpg -profile /Users/fred/images/profiles/USWebCoatedSWOP.icc -profile /Users/fred/images/profiles/sRGB.icc KW3Snub_srgb.jpg
which now looks like the first image.