Computer Graphics/Color Models

From Wikibooks, open books for an open world
Jump to navigation Jump to search

A color model is an abstract mathematical model describing the way colors can be represented as tuples of numbers, typically as three or four values or color components. When this model is associated with a precise description of how the components are to be interpreted (viewing conditions, etc.), the resulting set of colors is called color space.

The RGB Model[edit | edit source]

The RGB model is the most common model of color used in digital devices (the other being CMYK for printing, see below). Color digital displays are based on the RGB model of color. In this model, three channels of Red, Green and Blue colors respectively are combined to form a particular color. The total number of possible colors that can be formed in this way is dependent on color depth, which specifies the total number of bits assigned to the three channels. More the number of bits, more the colors that can be made. Typically, each channel is assigned 8 bits, which gives a total of 224 = 24×1024×1024 (more than 16 million) possible colors. Although historically, displays with lower color depth have been used in applications like games. For movies requiring visual effects (VFX), color depth used can be more than 24. Also, the colors combine in additive manner, unlike subtractive combination of paints.

The HSB (or HSV) Model[edit | edit source]

The HSB color model.

The HSB model is based around three elements: "Hue", "Saturation", and "Brightness" (or Luminosity/Value). Brightness/Value represents how bright the color appears- the intensity of light, Hue stands for the pure color used. In this scheme, hue is represented by an angle in the color wheel. Red is 0 (or 360) degrees, Green is 120 degrees and Blue is 240 degrees. The other colors derived by combining these colors lie in between these ranges. For example, orange being a combination of red and yellow (red + green), would be close to 120/2/2 = 120/4 = 30 degrees and yellow itself would be close to 120/2 = 60 degrees. Similarly, magenta formed by combining red and blue would be close to (240+360)/2 = 300 degrees. Saturation is the the amount of hue present in the color. Less saturation implies more white and less hue. More saturation implies less white and more hue in the color. In HSB, 0% saturation stands for white. Otherwise, the color has some hue and is not completely white. 0% brightness means black. Otherwise, the color may be white (0% saturation) or be a color with hue (non-zero saturation).

The HSL Model[edit | edit source]

The HSL (Hue, Saturation, Light) model is similar to HSB model, but not quite. The hue part remains the same as HSB. However, 0% saturation actually gives gray instead of white (as in HSB). Also, 0% light gives black and 100% light gives white (irrespective of hue or saturation). So for pure hue, a light value of 50% is used. In HSL, saturation is the amount of hue in gray. 100% saturation is full color. While 0% saturation is full gray.

The CMYK Model[edit | edit source]

The CMYK model stands for Cyan, Magenta, Yellow and Key (which is just black). It is majorly used in printers and PDF documents. Unlike other models discussed above, it is a subtractive color model. Because it deals with ink printed on paper instead of light forming pixels on digital display. <TODO Explain how CMYK forms color>

The XYZ Model[edit | edit source]

This standard was set in 1931 by the International Commission on Illumination(CIE).

It is not practically possible to create a perfect spectrum of all possible colors. Having said that, it is possible to get nearly all possible colors using a set of "primary colors". These primary colors are hypothetical. No real primary colors are defined.