help: RGB to CMYK conversion

help: RGB to CMYK conversion

Post by Tri VU KHA » Tue, 01 Aug 2000 04:00:00



Hi folks,

Does anyone know where I can find this algorithm of conversion (RGB-CMYK) ?
Thank you so much.

Tri.

 
 
 

help: RGB to CMYK conversion

Post by Alexander Radchenk » Tue, 01 Aug 2000 04:00:00



>Hi folks,

>Does anyone know where I can find this algorithm of conversion (RGB-CMYK) ?
>Thank you so much.

This is linear formulas

/////////////////////// Convert CMYK to RGBA using linear formulas
  for ( i=0, rgba_buf = m_Buffer, cmyk_buf = pBuf;
     i<m_Width*m_Height;
     i++, rgba_buf+=4, cmyk_buf+=4) {
   double tRed = (*rgba_buf)/255.0;     //
   double tGreen = (*(rgba_buf+1))/255.0;  // Normalize to [0,1]
   double tBlue = (*(rgba_buf+2))/255.0;   //
   double Black = __min(__min(1-tRed, 1-tGreen), 1-tBlue);;
   double i_black = 1-Black;
   double Cyan = 1-tRed/i_black;
   double Magenta = 1-tGreen/i_black;
   double Yellow = 1-tBlue/i_black;
   *cmyk_buf     = (BYTE)(Cyan*255);     //
   *(cmyk_buf+1) = (BYTE)(Magenta*255);  //
   *(cmyk_buf+2) = (BYTE)(Yellow*255);   //   Normalize to [0,255]
   *(cmyk_buf+3) = (BYTE)(Black*255);    //
  }
 }

But this conversation _very crude_
If you need more accurate converation, like Photoshop, you can use ICC
profiles http://www.abaforum.es/martim/lcms.htm

 
 
 

1. Help (CMYK - RGB conversion algorithm needed)

Has anybody out there got an algorithm or know
where one can be found for doing RGB - CYMK conversions?
Help greatly appreciated.  This is an urgent requirement.

Regards.
Ken Carroll

2. Light Wave vs. Truespace

3. help on RGB/CMYK conversion

4. Explain Texture mapping

5. help rgb->cmyk, ycc->cmyk, TIFF

6. Developers Info for Plugins (SDK, API or whatever)

7. 3dsMAX Books

8. DCS / CMYK --> RGB conversion

9. TIFF(CMYK) conversion to jpeg/tiff(RGB)

10. CMYK to RGB Batch conversion

11. RGB to CMYK conversion routines