Converting image from CMYK to sRGB, some colors are incorrect?
I have a jpeg image with CMYK mode and it does not have ICC profile embedded in the metadata. I want to simply convert it to sRGB mode.
// Sharp version 0.26.0
sharp('path-to-original.jpg').toFile('path-to-result.jpg');
| original | Load and save by Sharp |
|---|---|
![]() |
![]() |
The background color of the original image is pure black (#000000), but the background is brighter than the original in the result (#1f1f26 on my MacBook monitor).
Pure black is a safety color between CMYK and sRGB, so I think the result is incorrect.
I tried to convert it in Little CMS command jpgicc or Photoshop, the background color after conversion is pure black (#000000).
ORIGINAL URL: https://designer2.s3.us-west-1.amazonaws.com/resource/images/1/z3LqaAfESHVdtVVoJwODUWQW0BWPT1qL.jpg
CMYK input missing an embedded profile will fallback to using https://github.com/libvips/libvips/blob/master/libvips/colour/profiles/cmyk.icm
A CMYK value of (0,0,0,100) will only be the same as an RGB value of (0,0,0) if the profile says so, but this is usually not the case.
https://en.wikipedia.org/wiki/Rich_black
https://graphicdesign.stackexchange.com/questions/2984/what-kind-of-black-should-i-use-when-designing-for-cmyk-print
Thank you for your help @lovell, I learned more knowledge about the color difference between printing and display.
But there is another question, why LittleCMS and Photoshop can convert the result correctly I expected?
Did you try the https://github.com/libvips/libvips/blob/master/libvips/colour/profiles/cmyk.icm profile with LittleCMS?
I tried to use cmyk.icm from the libvips library as the input profile for jpgicc conversion, and the result was not quite correct too (#01000d on MacBook monitor), but it was very close to pure black.
And the cmyk.icc I used before was downloaded from Adobe official website : USWebCoatedSWOP.icc.zip
What flags are you passing to jpgicc at the command line, e.g. which rendering intent -t and/or black point compensation -b etc?
jpgicc -i cmyk.icc -o srgb.icc path-to-original.jpg path-to-result.jpg
@hdwong Were you able to make any progress with this?
Sorry, @lovell, I haven't make any progress on this issue. I still use the jpgicc command to convert the image from CMYK to RGB to make sure the colors are correct.
What about you?
Let's track this at #1324, as I think what is required is the ability to provide a custom CMYK input profile.

