Is there a place where I can get the formula which photoshop uses to convert rgb to cmyk?
I know there are formulas on the web, but photoshop does not use this formula. It converts the collors different.
Can someone tell me the photoshop formula?
Thanks!
Most likely, Photoshop uses a color profile for converting RGB to CMYK.
If you want to do the same with a .NET language on Windows, then there's an API for it:
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 from two different namespaces are used. And you probably need to add the PresentationCore DLL as a reference.
In this particular case, the ISO Coated v2 300% (ECI) profile is used. It can be downloaded from the downloads section of eci.org. It's part of a bigger ZIP file containing several profiles.
If you need to convert a complete image from CMYK to RGB, there are special classes in the same namespace that use a color profile as well.
There's a nice little online app for testing the CMYK color conversion with a color profile.
They are many different ICC Color Profiles for storing color as CMYK and RGB. There is no one end all be all encoding for color. There is RGB, sRGB, Adobe RGB, U.S. Web Coated (SWOP) v2, GRACol, etc.
As a print provider I'd ask what your end goal is. We can talk a bit about Photoshop scripting if you are looking to work with color objects in Adobe Javascript, but if this has to do with design I would lend this caution:
The RGB color space provides a wider color gamut (more colors), many photoshop effects are only available while working in RGB, and the RGB filesize is smaller (only storing 3 channels RGB, instead of 4 CMY & K).
If you save a document as CMYK when it goes to the printer device the printer hardware reinterprets the colors anyhow. So it does not benefit you to work in CMYK most of the time.
I do use PhotoShop, but a google search tells me that this varies by the devices you are using, and is controlled in Edit > Color Settings (Shift+Ctrl+K)
.