A color image is composed of three gray scale images for the three primary colors red, green and blue:

Based on the discussion on color perception, we know that a color can always be specified by three variables. But representing a color image by the three primary colors is not necessarily the most convenient way to do color image processing. Sometimes a different set of three variables, such as hue, saturation, and value (or intensity).

**RGB/YCM model**The red, green and blue are used as the three

*primary colors*which span a 3D space. The intensities of these primaries are calibrated to range from 0 to 1 so that all possible colors that can be produced by these primaries are located inside the cube as shown below:- The origin of the coordinate system at represents the black color
- The point represents the white color.
- The line segment between the black and white points represents different gray levels.
- The three colors Red, Green, Blue are called
*additive primaries*, - The three colors Yellow, Cyan, Magenta are called
*secondary or subtractive primaries*.

A cross section plane perpendicular to the line of grays and going through point is shown in the figure below:

Each side of the RGB cube is 1 with its eight vertices located at (black), (red), (green), (blue), (yellow) (magenta), (cyan), (white). The length of the diagonal is .

The RGB plane shown in the figure can be specified by the equation

An RGB triangle is formed by the three vertices , , and . In particular, note the following measurements on the triangle:- The center point of the triangle is .
- The lengths of its three sides are .
- The distance from the center to any of the vertices is .
- The distance from the center to the closet side is .
- The length of the line from a vertex to the middle of the opposing edge is .

This cross section has the shape of a hexagon with highly saturated hues along its sides (e.g., red, yellow, green, cyan, blue, and magenta in the middle part of the six sides, respectively), Also we see that the closer a color is to the line of grays, the less saturated it becomes. The third variable intensity is not represented in this cross section.

The YCM plane is specified by the equation

with the center at . Note that in this color cube, the primaries RGB are not on the same plane as the secondary primaries YCM.**Additive and subtractive colors**The primary colors R,G,B are additive colors used to describe the mixture of lights. In the background of black color (no light), the light corresponding to each of these primary colors will give us the color sensation of red, green or blue. Moreover, the mixture of any two of the three primary colors will give use the color sensation of yellow (R+G), magenta (R+B) and cyan (B+G). Finally the mixture of all three primaries (R+G+B) will give us the sensation of white color.

and

Note that here addition means mixture of lights.The secondary colors Y,C,M are subtractive colors used to describe the mixture of pigments or paints. In the background of white color (white paper), the pigments corresponding to each of Y, C, M will absorb one primary color: cyan absorbs (subtracts) red (C=W-R), magenta absorbs (subtracts) green (M=W-G), and yellow absorbs (subtracts) blue (Y=W-B). Moreover, the mixture of pigments of two secondary colors will also absorb more colors: mixture of C and M appears blue as both R and G are absorbed (W-R-G=B), mixture of C and Y appears green as both R and B are absorbed (W-R-B=G), and mixture of Y and M appears red as both Y and G are absorbed (W-Y-G=R). Finally, the mixture of all three secondaries appears black as all R, G and B are absorbed.

Note that here addition means mixture of pigments.**The HSV/HSI model**Alternatively, a color can be specified by a set of three different variables: the Hue (H), Saturation (S), and value (V) or intensity (I).

These two models are called HSV and HSI models, respectively. Any color is represented by a 3D point in the solid, with its hue represented by the angle with respect to red, its value or intensity represented by the vertical distance from zero representing black, and its saturation represented by the horizontal distance to the closest side.

**The Cone Models**The hue, saturation and intensity of colors can also be represented by a similar model as shown below:

A horizontal cross section going through the middle of the cone is shown here:

Two perpendicular vertical cross sections cutting through center of the cone are also shown: