PANDORE Version 6 GREYC-IMAGE

prgb2cmyk



Converts RGB color image to Cyan-Magenta-Yellow-Key color image.



Synopsis

prgb2cmyk [-m mask] [im_in|-] [im_out|-]

Description

prgb2cmyk converts color image from the color space RGB (Red, Green, Blue) to the color space CMYK (Cyan, Magenta, Yellow, Key).

The CMYK color model is a subtractive color model, used in color printing. CMYK refers to the four inks used in some color printing: cyan, magenta, yellow, and key (black).

The conversion from RGB to CMYK uses the following algorithm:

 if (R=0 and G=0 and B==0) then C=0; M=0; Y=0; K = 255;
 else
   x = 1 - (R/255);
   y = 1 - (G/255);
   z = 1 - (B/255);

   min = MIN(x, MIN(y,z));
   C = (x - min) / (1 - min) *255;
   M = (y - min) / (1 - min) *255;
   Y = (z - min) / (1 - min) *255;
   K = min * 255;

Inputs

Outputs

Result

Returns SUCCESS or FAILURE.

Examples

Converts parrot.pan from rgb to cmyk, and stoire the cyan band.

   prgb2cmyk parrot.pan a.pan
   pgetband 0 a.pan cyan.pan

See also

Color, pcmyk2rgb

C++ prototype

Errc PRGB2CMYK( const Imc2duc &im_in, Imc2dsf &im_out );

Version française

Changement d'espace couleur de RGB vers Cyan-Magenta-Yellow-Key.


Author: Régis Clouard