YUV Color Space

YUV[1] defines each pixel has:

It can be convert to and from RGB model and other color spaces.

Luminance:

luminance-illustratiion.png|300

Chrominance (U, V) (Blue, Red projection):
chrominance-illustration.png|300

❓Why YUV instead of RGB

Typical RGB has 8 bits per compoment (R, G, B) with a total 24 bits per pixel. However, YUV can be 4 bits per compoment (Y, U , V) with a total 12 bits per pixel.
This reduce the space when storing pixel in the memory and reduce the bandwidth when video transportation.

❓What is YUV 8bits and 10bits?

YUV 8 bits and 10 bits are represent as the depth of each compoment, e.g. Y, U and V.

Common YUV format

YUV Format Bits per Pixel (8bit) Description
#YUV4 4 4 format 24
#YUV4 2 2 format 16
#YUV4 2 0 format 12 also known as i420
#YUV4 1 1 format 12

YUV4:4:4 format

Each pixel contains Y, U and V compoments and each compoments are 1 byte.

YUV4:2:2 format

Each 2 horizontal pixels contains 2 Y, 1 U and V compoments and both pixels share the same U and V. YUV4:2:2 has different packed format, check here.

YUV4:2:0 format

Each 2 horizontal and 2 vertical pixels (total 4 pixels) contains 4 Y, 1 U and 1 V compoments and four pixels share the same U and V.

YUV4:1:1 format

Each 4 horizontal pixels (total 4 pixels) contains 4 Y, 1 Y and 1 U compoments and four pixels share the the same U and V.

⚙️ YUV444 to / from RGB888 conversion

to YUV Fomula:

[YUV]=[0.2990.5870.1140.147130.288860.4360.6150.514990.10001][RGB]

to RGB Folula:

[RGB]=[101.1398310.394650.5806012.032110][YUV]

Where:


  1. https://en.wikipedia.org/wiki/YUV ↩︎