Monday, October 06, 2008

Gamma, sRGB

CRT and other output devices have a nonlinear display characteristic, usually parameterized by gamma: 
_LARGE_!I = v_{in} ^{_gamma}
  where v_in is the CRT input voltage, I is the light intensity output, and gamma value usually ranges from 1.8 to 2.5. Because of this nonlinearity, video camera manufactures have routinely implemented a gamma correction into their cameras for nominal value gamma = 2.2, thus precompensating the camera output voltage as
_LARGE_!v_{out} = v_{in} ^{{1} _backslash {_gamma}}
Since v_in is proportional to I for a CCD or CMOS sensor, this near square-root function behaves similar to the log used in defining contrast. So the usual camera output is more contrast than intensity. The following figure uses the 2nd equation first, then the 1st equation.
180px-Gamma06_600 Gamma_on_TV

[from wiki] When gamma < 1, called encoding gamma (or gamma compression: encode linear luminance or GRB values into video signal), when gamma > a, called decoding gamma (gamma expansion).

sRGB color space standard is used for most cameras, PCs, and printers. sRGB does not use a simple (single) numerical value as above, but has a decoding gamma value near 2.2 over much of its range.

CIE XYZ to sRGB
Linear transformation first, but it is not final result

sRGB was designed to reflect a typical real-world monitor with a gamma = 2.2, the following eq. transforms the linear values into sRGB (C_linear is R,G, or B_linear, C_srgb is R,G or B_srgb):

a = 0.055. These gamma correction values are in the range 0 - 1(0-255? *255). So sRGB is the value after gamma correction. If you want to convert sRGB to XYZ, you need a reverse gamma correction:

sRGB to XYZ
R,G,B_srgb are in the range of 0 - 1 (0-255? / 255). We get XYZ from a linear RGB, and the linear RGB is from sRGB.
where

No comments:

Post a Comment