title: Converting RGB to CMYK , Using ICC Profile
body: <p>I'm about to converting RGB color to CMYK for printing purpose. 
  scale of this conversion is Adobe Photoshop <code>( Image -&gt; Mode -&gt; CMYK color )</code></p>
  
  <p>I tried 2 solution , but none of them return the right value :</p>
  
  <h2>Solution 1 - Using .NET Framework</h2>
  
  <p>At first , I followed by these steps</p>
  
  <ul>
  <li><p>Download ICC profiles (windows version) from <a href="http://www.adobe.com/support/downloads/detail.jsp?ftpID=4075" rel="nofollow noreferrer">Adobe</a></p></li>
  <li><p>Convert the <code>#color</code> <a href="https://github.com/Aether-Hemera/DMX-Deck/blob/master/Serial%20DMX%20Winforms%20Deck/SerialDmxDeck/ColorSpace/ColorSpaceHelper.cs#L637" rel="nofollow noreferrer">to CMYK</a> </p></li>
  <li><p>used <code>System.Windows.Media.Color.FromValues // return Color</code> <a href="http://msdn.microsoft.com/en-us/library/system.windows.media.color.fromvalues%28v=vs.100%29.aspx?cs-save-lang=1&amp;cs-lang=csharp#code-snippet-1" rel="nofollow noreferrer">MSDN</a></p></li>
  <li><p><code>string convretedColor = string.Format("#{0:X2}{1:X2}{2:X2}", _color.R, _color.G, _color.B)</code></p></li>
  </ul>
  
  <p>here is the result : </p>
  
  <ul>
  <li><p>profile : <code>CoatedFOGRA27.icc</code> </p></li>
  <li><p>Original Color : <code>#2f00ff</code></p></li>
  <li><p>Converted Color : <code>#3b4996</code></p></li>
  <li><p>Result of conversion With Adobe Photoshop (same profile) : <code>#3b4996</code> <a href="http://jsfiddle.net/edbze/" rel="nofollow noreferrer">not even close!</a></p></li>
  </ul>
  
  <h2>Solution 2 - Using Windows Color System ( WCS )</h2>
  
  <p>I also tried the <a href="https://stackoverflow.com/a/5251318/191220">Codo's solution</a> with same procedure </p>
  
  <p>here is the result : </p>
  
  <ul>
  <li><p>Profile : <code>CoatedFOGRA27.icc</code></p></li>
  <li><p>Original Color : <code>#2f00ff</code></p></li>
  <li><p>Converted Color : <code>#2032FF</code></p></li>
  <li><p>Photoshop : <code>#3b4996</code></p></li>
  </ul>
  
  <p><a href="http://jsfiddle.net/edbze/1/" rel="nofollow noreferrer">JSFiddle for compare</a></p>
  
  <h1>EDIT</h1>
  
  <p>According to Codo's Comments, I think, I have some fundamental problems of understanding colors concept !! ( please correct me if I'm wrong )</p>
  
  <p>For any color, we have different color models , <code>RGB</code> , <code>CMYK</code>, ...</p>
  
  <p><code>RGB</code> shows the combination of (Red Green Blue) to generate color and CMYK as well (Cyan Magenta Yellow * ). the values of these models can easily convert to each-other.</p>
  
  <p><a href="http://web.forret.com/tools/color.asp?rgb=2f00ff" rel="nofollow noreferrer">for example</a> : </p>
  
  <ul>
  <li><p>RGB HEX : <code>#2F00FF</code></p></li>
  <li><p>RGB : <code>47 - 0 - 255</code></p></li>
  <li><p>CMYK : <code>0,816 - 1,000 - 0,000 - 0,000</code></p></li>
  </ul>
  
  <p>Almost, all monitors use <code>RGB</code> to shows the colors.the printed color (because of using Ink instead of LED o ...) is totally different from the color that you see on monitor/</p>
  
  <p>For this issue, Image Editors like Photoshop use <code>CMYK **MODE**</code>.In this mode , if you select the <code>RGB</code> color, the editor convert it to color that you see after printing and shows that to screen.this conversion is absolutely depend on color Profiles ( here ICC )</p>
  
  <h1>EDIT 2</h1>
  
  <p><img src="https://i.stack.imgur.com/b6LP6.jpg" alt="enter image description here"></p>