In this infinite cosmos we have only one life each. A life in this infinite cosmos is just like a dust in the world. Born by chance and die in necessity. Feeble life and boundless world, two facts we face. Even if you spend your whole life solving them. You will get nothing. - 1998

Thursday, October 12, 2006

Color Space Conversion 颜色空间转换

A system for describing color numerically. Also known as a "color model," the most widely used color spaces are RGB for scanners and displays, CMYK for color printing and YUV for video and TV. Prior to the proliferation of electronic displays, color spaces were developed that were closer to the way people perceive color. For example, the HSB model uses hue, saturation and brightness, while the CIE Lab model uses lightness (L) and values on red-green (a) and blue-yellow (b) axes.

Changing one type of color-encoded signal into another. Converting from RGB to YUV and back to RGB are common color space conversions (see YUV). Converting from the display color space (RGB) to the printer color space (CMYK) is another common example. Color spaces may have different gamuts (color ranges), and conversion may result in a loss of color.

(YUV) The Y in YUV stands for "luma," which is brightness, or lightness, and black and white TVs decode only the Y part of the signal. U and V provide color information and are "color difference" signals of blue minus luma (B-Y) and red minus luma (R-Y). Through a process called "color space conversion," the video camera converts the RGB data captured by its sensors into either composite analog signals (YUV) or component versions (analog YPbPr or digital YCbCr). For rendering on screen, all these color spaces must be converted back again to RGB by the TV or display system.

(Red Green Blue) The color space used for capturing still and moving color images, as well as displaying them on screen. Color is captured by sensors that record the varying intensities of red, green and blue at each pixel location in the frame (x-y matrix).

(Cyan Magenta Yellow blacK) The color space used for commercial printing and most color computer printers. In theory, cyan, magenta and yellow (CMY) can print all colors, but inks are not pure and black comes out muddy. The black ink (K) is required for quality printing.

(Hue Saturation Brightness) A color space that is similar to the way an artist mixes colors by adding black and white to pure pigments. The pigments are the hues (H), measured in a circle from 0 to 359 degrees (0=red, 60=yellow, 120=green, 180=cyan, 240=blue, 300=magenta). The saturation (S) is the amount of black, and the brightness (B) is the amount of white, each measured from 0 to 100%.

Following are the conversion formulas from RGB to YUV and from YUV to RGB.
From RGB to YUV

Y = 0.299R + 0.587G + 0.114B
U = 0.492 (B-Y)
V = 0.877 (R-Y)

It can also be represented as:
Y = 0.299R + 0.587G + 0.114B
U = -0.147R - 0.289G + 0.436B
V = 0.615R - 0.515G - 0.100B

From YUV to RGB
R = Y + 1.140V
G = Y - 0.395U - 0.581V
B = Y + 2.032U


Post a Comment

<< Home