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.

1) Pick a programming language. SO isn't the place for abstract algorithms 2) MUST it be the exact algorithm PS uses, or can it be a working one for RGB-CMYK? If it must be the exact one, then you're never going to get a valid answer because only the PS team knows and they're not giving that info out.
–
WillFeb 7 '11 at 15:42

No it must be the same result. That's the most inportant thing.
–
Van CodingFeb 7 '11 at 15:54

There are many different ways color transforms can generally be programmed, let alone within PhotoShop itself. Where is the area of PhotoShop's color tranform behavior that your trying to reproduce? e.g. in the color picker UI or after appying a new icc profile to a document.
–
jeffrbauerJun 30 '12 at 0:36

Hi Codo, thanks for your great piece of code. I understand that this is for going from CYMK to RGB. Could you add another bit where we can convert from RGB to CYMK (the other way around)? Kind regards
–
ibizaMar 8 '11 at 16:36

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.