|
» AviSynth is a powerful video FrameServer for Win32. AviSynth Links: » You can add pages to this website
immediately. No login required.
|
(0.0 <= [Y,R,G,B] <= 1.0) ; (-1.0 < [U,V] < 1.0) Kg = 1 - Kr - Kb Y = Kr*R + Kg*G + Kb*B V = (R - Y)/(1-Kr) = R - G * Kg/(1-Kr) - B * Kb/(1-Kr) U = (B - Y)/(1-Kb) = - R * Kr/(1-Kb) - G * Kg/(1-Kb) + B R = Y + V*(1-Kr) G = Y - U*(1-Kb)*Kb/Kg - V*(1-Kr)*Kr/Kg B = Y + U*(1-Kb) Converting to programming valuesYUV [0,255] <-> RGB [0,255] (0 <= [r,g,b] <= 255, 0 <= y <= 255, -127.5 < [u,v] < 127.5) y = Y * 255 v = V * 255 u = U * 255 r = R * 255 g = G * 255 b = B * 255 Since you can divide the factor 255 out, the equations above remain the same (where Y,V,U,R,G,B are replaced by y,v,u,r,g,b). YUV [16,235] <-> RGB [0,255] (0 <= [r,g,b] <= 255, 16 <= y <= 235, 16 <= [u,v] <= 240) y = Y * 219 + 16 u = U * 224 + 128 v = V * 224 + 128 r = R * 255 g = G * 255 b = B * 255 References:http://www.poynton.com/notes/colour_and_gamma/ColorFAQ.html ITU bt.601 ... ITU bt.709 ... |