RGB and YUV color space conversion is used to translate color representation from one color space to the other.
The RGB color space is the most usable color space for displays. It’s an additive color model in which red, green, and blue light are added together in various ways to reproduce a broad array of colors.
YUV Color Space
YUV is a color space typically used for color image/video processing. It encodes a color image/video taking into account properties of the human eye that allow for reduced bandwidth for chroma components without perceptual distortion. Using the YUV color space can be helpful for image/video compression. It was first used in analog TV broadcasting. Color spaces YUV, YIQ, YCbCr, and YPbPr all belong to the YUV family.
YUV to RGB
The conversion between RGB and YUV for HDTV (BT.601).
The conversion between RGB and YUV for HDTV (BT.709).
YIQ is the color space utilized by the NTSC color TV
YDbDr, is the colour space used in the SÉCAM
YCbCr is a scaled and offset version of the YUV color space. Y has an 8-bit range from 16 to 235. Cb and Cr have a range of 16-240. YCbCr is used for JPEG compression.
If the RGB data has a range of 0-255 (black-white), as is commonly found in PCs, the following equations should be used to maintain the correct black and white levels: