In video, computer graphics and image processing the "gamma" symbol represents a numerical parameter that describes the nonlinearity of intensity reproduction. The Gamma FAQ section of this document clarifies aspects of nonlinear image coding.
The Colour FAQ section of this document clarifies aspects of colour specification and image coding that are important to computer graphics, image processing, video, and the transfer of digital images to print.
Colorspace-faq was originated by David Bourgin <dbourgin@turing.imag.fr>, who has ceded responsibility for maintenance at RTFM and periodic posting. This version of colorspace-faq comprises concatenated GammaFAQ and ColorFAQ documents which were previously available -- and remain available -- by ftp; see G-0 below.
Adrian Ford and Alan Roberts have written a Colour Equations FAQ that details transforms among colour spaces such as RGB, HSI, HSL, CMY and video. Find it at ftp.wmin.ac.uk/pub/itrg/coloureq.txt(48 KB).
Lstar = -16 + 116 * (pow(Y / Yn), 1. / 3.)
Rprime = ( R <= 0.018 ? 4.5 * R : -0.099 + 1.099 * pow(R, 0.45) );
R = ( Rprime <= 0.081 ? Rprime / 4.5 : pow((Rprime + 0.099) / 1.099, 1. / 0.45) );
Y = 0.212671 * R + 0.715160 * G + 0.072169 * B;
Yprime = 0.299 * Rprime + 0.587 * Gprime + 0.114 * Bprime;
x = X / (X + Y + Z); y = Y / (X + Y + Z);
X = (x / y) * Y; Z = (1 - x - y) / y * Y;
x y z R 0.6400 0.3300 0.0300 G 0.3000 0.6000 0.1000 B 0.1500 0.0600 0.7900 white 0.3127 0.3290 0.3582
[ R709 ] [ 3.240479 -1.53715 -0.498535 ] [ X ] [ G709 ]=[-0.969256 1.875991 0.041556 ]*[ Y ] [ B709 ] [ 0.055648 -0.204043 1.057311 ] [ Z ]
{{ 3.240479,-1.53715 ,-0.498535}, {-0.969256, 1.875991, 0.041556}, { 0.055648,-0.204043, 1.057311}}
[ X ] [ 0.412453 0.35758 0.180423 ] [ R709 ] [ Y ]=[ 0.212671 0.71516 0.072169 ]*[ G709 ] [ Z ] [ 0.019334 0.119193 0.950227 ] [ B709 ] {{ 0.412453, 0.35758 , 0.180423}, { 0.212671, 0.71516 , 0.072169}, { 0.019334, 0.119193, 0.950227}}
[ R709 ] [ 0.939555 0.050173 0.010272 ] [ R240M ] [ G709 ]=[ 0.017775 0.965795 0.01643 ]*[ G240M ] [ B709 ] [-0.001622 -0.004371 1.005993 ] [ B240M ] {{ 0.939555, 0.050173, 0.010272}, { 0.017775, 0.965795, 0.01643 }, {-0.001622,-0.004371, 1.005993}}
[ R709 ] [ 1.044036 -0.044036 0. ] [ R240M ] [ G709 ]=[ 0. 1. 0. ]*[ G240M ] [ B709 ] [ 0. 0.011797 0.988203 ] [ B240M ] {{ 1.044036,-0.044036, 0. }, { 0. , 1. , 0. }, { 0. , 0.011797, 0.988203}}
----+ ----------+ R | G B R G | B | | Cy | Mg Yl Cy Mg | Yl +---------- +-----
Eq 1 [ Y' 601 ] [ 0.299 0.587 0.114 ] [ R' ] [ B'-Y' 601 ]=[-0.299 -0.587 0.886 ]*[ G' ] [ R'-Y' 601 ] [ 0.701 -0.587 -0.114 ] [ B' ] {{ 0.299, 0.587, 0.114}, {-0.299,-0.587, 0.886}, { 0.701,-0.587,-0.114}}
Eq 2 [ Y' 601 ] [ 0.299 0.587 0.114 ] [ R' ] [ PB 601 ]=[-0.168736 -0.331264 0.5 ]*[ G' ] [ PR 601 ] [ 0.5 -0.418688 -0.081312 ] [ B' ] {{ 0.299 , 0.587 , 0.114 }, {-0.168736,-0.331264, 0.5 }, { 0.5 ,-0.418688,-0.081312}}
[ R' ] [ 1. 0. 1.402 ] [ Y' 601 ] [ G' ]=[ 1. -0.344136 -0.714136 ]*[ PB 601 ] [ B' ] [ 1. 1.772 0. ] [ PR 601 ] {{ 1. , 0. , 1.402 }, { 1. ,-0.344136,-0.714136}, { 1. , 1.772 , 0. }}
{{ 65.481, 128.553, 24.966}, { -37.797, -74.203, 112. }, { 112. , -93.786, -18.214}} Add [16, 128, 128] to the product to get Y'CBCR.
{{ 0.00456621, 0. , 0.00625893}, { 0.00456621,-0.00153632,-0.00318811}, { 0.00456621, 0.00791071, 0. }}
{{ 65.738, 129.057, 25.064}, { -37.945, -74.494, 112.439}, { 112.439, -94.154, -18.285}}
{{ 298.082, 0. , 408.583}, { 298.082, -100.291, -208.12 }, { 298.082, 516.411, 0. }}
{{ 65.481, 128.553, 24.966}, { -37.797, -74.203, 112. }, { 112. , -93.786, -18.214}}
{{ 256. , 0. , 350.901}, { 256. , -86.132, -178.738}, { 256. , 443.506, 0. }}
[ R'709 ] [ 0.0054980 0.0000000 0.0051681 ] [ Y'601,189 ] [ 0 ] [ G'709 ]=[ 0.0054980 -0.0015446 -0.0026325 ]* ( [ C1 ] - [ 156 ] ) [ B'709 ] [ 0.0054980 0.0079533 0.0000000 ] [ C2 ] [ 137 ] {{ 0.0054980, 0.0000000, 0.0051681}, { 0.0054980, -0.0015446, -0.0026325}, { 0.0054980, 0.0079533, 0.0000000}}
[ 1 1 0 0 1 1 0 0 ] [ 1 1 1 1 0 0 0 0 ] [ 1 0 1 0 1 0 1 0 ]
uprime = 4 * X / (X + 15 * Y + 3 * Z); vprime = 9 * Y / (X + 15 * Y + 3 * Z);
ustar = 13 * Lstar * (uprime - unprime); vstar = 13 * Lstar * (vprime - vnprime);
astar = 500 * (pow(X / Xn, 1./3.) - pow(Y / Yn, 1./3.)); bstar = 200 * (pow(Y / Yn, 1./3.) - pow(Z / Zn, 1./3.));