Wednesday, February 4, 2009

Color Spaces

Color spaces are abstract models of describing colors mathematically.  Typically they consist of three or four tuples known as color components that map a color to the color space.

One of the easiest color models to understand is RGB.  RGB is a three tuple consisting of the red, green, and blue content in a pixel.  In this system, 0 is considered black while the maximum value is considered white (typically 255 with 24 bits per pixel).  This can be pictured conceptually as a cube where one corner is pure black and the opposite corner is pure white.  The line connecting the two corners is grayscale, and everything else represents some visible color in the space.

There are several other color models, such as CMYK, HSV, and YUV.  The color model that interests us in our project is L*a*b*.


The CIE L*a*b*, unlike RGB or CMYK, does not use a subjective set of primary colors, which makes it device independent.  It describes colors along three axes in 3D space - the L* axis corresponds to the lightness of a color - a value of 0 is pure black, while a value of 100 is pure white.

The other two axes, a* and b*, theoretically have no upper or lower bounds.  Negative a* corresponds to a green color, positive to a red color.  Negative b* to a blue color, positive to a yellow color.  In reality these are often bounded between -128 and 127, depending on the number of bits used to represent the color. 

The L*a*b* color model was designed to approximate human vision.  The L component closely matches with human perception of lightness.  Differences between colors can be determined in terms of distance between them - which is sometimes defined in terms of the minimum aount of color variation between two shades discernible to the human eye.


Sources:

http://www.hunterlab.com/appnotes/an07_96a.pdf
http://www.kleerdex.com/briefs/177.pdf
http://en.wikipedia.org/wiki/Lab_color_space

No comments:

Post a Comment