Color Conversion

This topic describes the color conversion between RGB and YUV. The details depend on which YUV color space is used.

For analogue signals (standard definition), the ITU BT-601 formula is used.

R' = Y' + 1.403V'
G' = Y' - 0.344U' - 0.714V'
B' = Y' + 1.770U'

For high-definition signals, the ITU BT-709 formula is used.

R' = Y' + 1.5701V'
G' = Y' - 0.1870U' - 0.4664V'
B' = Y' - 1.8556U'

Where,

  • Y' is Y scaled to be in the range [0, 1].
  • U' and V' are the corresponding samples scaled to the range [-0.5, 0.5].
  • R', G' and B' then have to be clamped to the range [0, 1] and scaled up as appropriate.
Related concepts
YUV Pixel Formats Overview