Conversion formula from RGB to YCbCr

21,831

If it still actual they are almost the same. Differences are what value ranges you'll get in the result.

From Wiki's matrix (R',G',B' = 0..1) values will be: Y = 0..219, Cb = -112..112, Cr = -112..112. You can bring it to other matrices with dividing Y formula by 219, and Cb, Cr fomulas by 224.

From Microsoft's one (R,G,B = 0..255) you'll get Y = 0..255, Cb ≈ -127.5 .. 127.5, Cr ≈ -127.5 .. 127.5

The third matrix solves problems with negative numbers by adding 128 to them. The difference from Microsoft's matrix lies in the matrices multiplication.

Share:
21,831
Red Viper
Author by

Red Viper

Updated on July 17, 2022

Comments