Page 1 of 1
Problem with converting a CMYK image to RGB
Posted: 2016-02-18T06:38:32-07:00
by gorszy
I have a problem with a CMYK image which I can't properly convert into an RGB image. The original image looks OK in the Windows image viewer or in other viewers, but not in Firefox or Chrome - the skintone is reddish, the whole image looks oversatured.
The image is available here:
//removed
It has an embedded profile and I'm using the sRGB_v4_ICC_preference.icc to convert it to RGB by running:
Code: Select all
convert cmyk.jpg -profile sRGB_ICC_v4_appearance_beta_displayclass.icc -colorspace sRGB srgb.jpg
The result looks like this - original on the left, converted on the right - looks similar to how the browsers display the original image:
//removed
I've tried also:
Code: Select all
convert cmyk.jpg -profile sRGB_ICC_v4_appearance_beta_displayclass.icc srgb.jpg
the image will still look bad in browsers (and identify says it's still CMYK).
I'm using ImageMagick 6.9.1-3 Q16 i686 2015-07-01 on Windows 10 64-bit on 32-bit Cygwin.
Re: Problem with converting a CMYK image to RGB
Posted: 2016-02-18T07:24:41-07:00
by snibgo
gorszy wrote:It has an embedded profile ...
cmyk.jpg doesn't have an embedded profile. Try "identify -verbose". (Or, if it does, IM can't see it.)
So you can convert it to sRGB either with a simple "-colorspace sRGB" or by first assigning a CMYK profile, then converting to a sRGB profile.
You should use one or other method. Your command confuses the two methods.
Code: Select all
convert cmyk.jpg -colorspace sRGB x2.jpg
Code: Select all
convert cmyk.jpg -profile USWebUncoated.icc -profile sRGB_v4_ICC_preference.icc x.jpg
The simple method gives a reddish cast to the skin. That is probably what web browsers do (because there is no embedded profile).
Re: Problem with converting a CMYK image to RGB
Posted: 2016-02-18T08:25:39-07:00
by gorszy
Thanks for response. I didn't realize some of my CMYK samples haven't had an ICC profile - i've seen identify printing several profiles, but now I see none of them was ICC (the sample from the first post was even worse, because I couldn't post the whole image and cropping it removed all other profiles as well).
So I assume I should use:
Code: Select all
convert cmyk.jpg -profile sRGB_ICC_v4.icc srgb.jpg
for CMYK images with an embedded profile and use a stock CMYK profile:
Code: Select all
convert cmyk.jpg -profile ISO_CMYK.icc -profile sRGB_ICC_v4.icc srgb.jpg
for CMYK images without an embedded profile (worked quite well with the sample from the first post, definitely better than just -colorspace sRGB)?
Re: Problem with converting a CMYK image to RGB
Posted: 2016-02-18T08:35:06-07:00
by snibgo
Yes, that's correct. When an image has an embedded profile, you need just one "-profile" to convert to sRGB. When it has no embedded profile, the first "-profile" assigns a profile and the second converts the image.
In this example, the two-stage profile conversion gives the more pleasing result, but of course we are guessing at the CMYK profile that was used to encode the image. Some other profile might be more accurate.