CMYK 2 RGB problem

I have a problem converting CMYK color to RGB. There are many formulas on the internet for converting it, but for example when I convert CMYK (0,100,100,0) to RGB it gets the value (255 0 0), but in Adobe Photoshop RGB the value is (237,28,36), and I want this one. Does anyone know how to convert it using java or .NET?

+2


a source to share


4 answers


Other questions ask the same thing:



The general gist of your problem is that Photoshop is applying a color profile where like you just do a direct conversion. Please see my answers to some other questions as I feel like I answered this question to death.

+4


a source


If you want good results, you need to apply a color profile. In .NET, you can do it like this (assuming the original CMYK components are in the range 0 to 255):

float[] colorValues = new float[4];
colorValues[0] = c / 255f;
colorValues[1] = m / 255f;
colorValues[2] = y / 255f;
colorValues[3] = k / 255f;

System.Windows.Media.Color color = Color.FromValues(colorValues,
    new Uri(@"C:\Users\me\Documents\ISOcoated_v2_300_eci.icc"));
System.Drawing.Color rgbColor = System.Drawing.Color.FromArgb(color.R, color.G, color.B);

      

Note that two different Color classes are used from two different namespaces. And you probably need to add the PresentationCore DLL as a reference.



The required color profile can be downloaded from the eci.org download section . This is part of a large zip file containing multiple profiles. They explicitly recommend using the ISO Coated v2 300% (ECI) profile.

There is a nice website showing a CMYK to RGB color conversion with a color profile at work.

If you need to convert a full image from CMYK to RGB, there are special classes in this namespace for that.

+1


a source


if you want to do photoshop like cmyk conversion use java java library; there is a class called EnumeratedSpace that does the job for you;

please don't forget the bitmask, because the return values ​​are rgb bytes.

0


a source


ColorJizz can convert from RGB to CMYK and many other formats. There is a .NET version there.

-1


a source







All Articles