User Contributed Notes 2 notes

When getting a color value back with getColorValue, you are free to use any color scheme: either the Red/Green/Blue (RGB) scheme or the Cyan/Magenta/Yellow/blacK (CMYK) scheme. For RGB, this function works with the constant values of "COLOR_RED", "COLOR_GREEN", and "COLOR_BLUE," and for CMYK, this function works with the constant values of "COLOR_CYAN", "COLOR_MAGENTA", "COLOR_YELLOW", and "COLOR_BLACK". As a programmer, the main question you're probably asking yourself is "How do I know if one pixel's color is different from the others?" That seems to be defined as a unique combination of RGB *or* CMYK values. Each RGB set of values with have a unique set of CMYK values for only that set of RGB values, so an RGB of 1/0.5/0.5 with have a unique set of CMYK values, shared only by the other pixels of the same exact RGB values.

Why the CMYK? Because that is the standard for printing, or to quote the Imagick site, "As such for printing we use four colored inks: Cyan, Magenta, Yellow, and blacK; and define images using these inks, to form a CMYK color space." By being a "color space", you get the choice of working with either RGB or CMYK when defining a pixel as being unique among a set of pixels. But you are completely free to go with either RGB or CMYK. For more on it from the Imagick Site: