1

following up on my first question ( C# convert RGB value to CMYK using an ICC profile? )

I would like to know if/how it is possible to generate RGB values only that have a direct equivalent in CMYK?

Kind of like the old gif format that only has a palette of 256 colors, is it possible to generate RGB values constrained by a palette (the CMYK one here)?

Thanks

Community
  • 1
  • 1
Bruno
  • 4,685
  • 7
  • 54
  • 105

2 Answers2

4

Well, CMYK is based on a 0-100 scale, unlike RGB which is 0-255. So, there are only 100 "greyscales" in CMYK vs 256 in RGB.

Try "babelfishing" an input RGB value; convert it to CMYK using whatever conversion algorithm you like, then convert THAT back to RGB to get the "closest match". As long as you can then convert this closest match to CMYK and back ad nauseum, you've found an RGB value that will translate 1:1 to RGB. If the color keeps skewing, there's probably something wrong with the conversion, one way or the other. I don't know the specifics of RGB-CMYK conversion, and there isn't just one algorithm.

EDIT: Check the remark at the bottom of this RGB->CMYK converter: http://web.forret.com/tools/color.asp?R=85&G=85&B=68. According to this, CMYK can represent MORE colors than RGB because of the extra dimension of black. I call shenanigans, but I guess it again depends on your specific converter implementation. Wikipedia simply says it is "difficult" because CMYK values are more hardware-dependent than RGB.

KeithS
  • 70,210
  • 21
  • 112
  • 164
  • Hi and thanks for your reply! This "babelfish" solution was exactly the first thing I thought of, but I am still missing the best way to convert a value from RGB to CMYK (with a provided ICC profile). In fact, this missing part is my first question (that I linked to, here). – Bruno Mar 08 '11 at 21:51
  • yeah, I can't gobble up either that CYMK can represent more colors than RGB, I wouldn't trust this site, XD – Bruno Mar 08 '11 at 22:44
1

The answer for this question is similar to the answer for C# convert RGB value to CMYK using an ICC profile?:

I don't know of any C# API or library that can achieve this. However, if you have enough C/C++ knowledge to build a wrapper for C#, I see two options:

Both systems offer APIs to check whether a color can be presented in the other color space.

Community
  • 1
  • 1
Codo
  • 75,595
  • 17
  • 168
  • 206