As I mentioned in an earlier post of mine, I have to create a color picker, so I’ve already started to write the code for the Color class it’s going to use. I need it to natively support RGB, HSL, Lab and CMYK. And the latter part is causing unexpected trouble.
It seems that there is the notion out there that conversion from CMYK to RGB is easy. Newsflash: It’s not. As every graphic designer knows, the CMYK color gamut is smaller than the the RGB color gamut (even the sRGB color gamut). You can’t take a CMYK color and convert it to an out-of-CMYK-gamut RGB color! That’s nonsense! And it’s precisely what most conversion algorithms and color pickers out there do! Even Adobe Kuler!!! Since yesterday, I’ve studied dozens of algorithms and color pickers that claim to do CMYK -> RGB conversion, and every single one of them is wrong.
You can test a color picker that claims to support CMYK, or a CMYK <–> RGB conversion algorithm in the following simple way: Test how it converts the color CMYK(100%, 0, 0, 0) to RGB. If the result is rgb(0,255,255) then the algorithm is crap. rgb(0, 255, 255) is neither the same color, nor is it even in the CMYK color gamut! So basically, these algorithms convert a CMYK color to an RGB color that is outside of the CMYK color gamut! A color that cannot be represented with CMYK is supposed to be the result of a CMYK->RGB conversion? This is madness!
So far the only CMYK -> RGB converter that I’ve seen and does it right, is the one used by Adobe CS products (Photoshop, Illustrator, etc). And that makes me wonder why Kuler does it the wrong way, since they have already figured the algorithm! It’s crazy!
What’s even more strange is that I can’t even find which sRGB colors are usually out of the CMYK color gamut, so that I can adjust the algorithm I use properly (even if it just clipped the color to the nearest in-gamut one, it would be an improvement). I’ve been searching since yesterady even for that with no luck. I hope I don’t end up using the wrong algorithm myself too…








After reading so much, I understand that the main problem is that adobe koler uses diferent CMYK conversion tables (ICC).
The correct way to understand this is knowing what ICC profile are you using in Photoshop (or Adobe software). If you use the sRGB IEC61966-2.1 profile then rgb(0,255,255) will be cmyk(57,0,13,0). Now, if you try it with a different profile for example ARRIFLEX D-20 Daylight Log (by Adobe), rgb(0,255,255) will be cmyk(100,0,0,0).
The main problem that you will find at this point, is that each user uses his own color profile, this represents that each navigator are using its own configuration, then a perfect translation is not possible at moment. Maybe knowing the current color profile you can use the tables to made a ‘perfect’ translation of the colors, or maybe using Flash Player there is a hack to know any information about the color profile.
For my project, I think I don’t will use the CMYK translation, you have reason with the target of the applications and I think this only can got me problems.
reggards and cya!
Marc
I’m currently trying to figure out how to properly convert CMYK to RGB values. So far, I haven’t been able to find a correct algorithm (for the reasons you describe).
One possibility I’m considering would be to understand how Scribus (free / opensource DTP software) does its conversions with CMYK RGB, as it does them quite well. Problem: the source code is really big and I’m quite lost in it. Maybe asking for help on the Scribus mailing list would provide basic explanations for a working algorithm.