Ch. 1 · Video Basics

한국어日本語
7 min

RGB vs YCbCr (YUV): Why Video Codecs Separate Brightness From Color

The eye is sensitive to brightness and dull to color, so codecs work in luma (Y) and chroma (Cb, Cr) instead of RGB. Includes BT.709 formulas and full vs limited range.

Camera sensors and display panels both work in RGB. Yet codecs take video in YCbCr (commonly called YUV) almost without exception. Why bother converting?

Two key reasons

① Human vision is sensitive to brightness and dull to color. If brightness and color are separated, you can cut data from the color side alone. ② R, G, and B are highly correlated with one another. Where it's bright, R, G, and B are all large. If you concentrate the overlapping information into one channel (Y), the information in the other two channels drops sharply.

RGB R — lots of info G — lots of info B — lots of info Three channels overlap convert YCbCr Y (luma) — most info is here Cb — smooth Cr — smooth Shrink chroma; eyes barely notice Halve the resolution of Cb·Cr only (next lesson)
The three RGB channels resemble each other, but after converting to YCbCr the information concentrates in Y

What Y, Cb, and Cr each are

  • Y (luma) — brightness. It's exactly the signal black-and-white TVs received. In fact, color broadcasting adopted this structure for compatibility with black-and-white sets.
  • Cb (blue-difference) — blue minus brightness. Roughly B − Y.
  • Cr (red-difference) — red minus brightness. Roughly R − Y.

The BT.709 (HD standard) conversion is below. Note that the coefficients give the greatest weight to G. The human eye is most sensitive to green.

BT.709 RGB → YCbCr (non-constant luminance)
Y'  =  0.2126 R' + 0.7152 G' + 0.0722 B'
Cb' = (B' - Y') / 1.8556
Cr' = (R' - Y') / 1.5748

* The prime (') means the value has gamma correction applied.
  Almost everything a codec handles is a primed value.
YUV and YCbCr are strictly different

YUV was originally a term from analog PAL broadcasting, while YCbCr is the digital representation. In the field everyone habitually calls it all 'YUV,' but when writing spec documents, YCbCr is correct. Add the distinction between Y'CbCr (gamma applied) and YCbCr (linear), and it gets more complicated still. What we handle is, in practice, always Y'CbCr.

Full range vs limited range

The value range of 8-bit video is 0–255. But because of broadcast legacy, two conventions coexist.

Y rangeCb/Cr rangeWhere it's used
Limited (TV, studio swing)16 ~ 23516 ~ 240Broadcast, most video files
Full (PC swing)0 ~ 2550 ~ 255PC graphics, some capture/screen content

The headroom (0–15, 236–255) was space to hold overshoot/undershoot in the analog era.

In the field — the most common bug in the world

99% of "the video looks washed out" or "black shows up as gray" is a misinterpreted range flag. Reading limited-range video as full kills the contrast; the opposite blows out highlights and shadows (clipping). Accidents where the bitstream's video_full_range_flag and the container metadata disagree happen really often.

Luma (Y')Luma

The gamma-corrected brightness component. Makes up most of a codec's data.

Chroma (Cb, Cr)Chroma / color difference

Color information with brightness removed. Blue difference and red difference.

Color matrixColor matrix

The set of RGB↔YCbCr conversion coefficients. BT.601, 709, and 2020 each differ.

Video full range flagVideo full range flag

A bit signaling whether the full 0–255 is used or it's limited to 16–235.

Luminance vs LumaLuminance vs Luma

Luminance is physical linear brightness (Y); luma is Y' after gamma. Often distinguished in papers.

Check yourself

What is the main reason codecs use YCbCr instead of RGB?

Check yourself

In 8-bit limited-range video, what Y value corresponds to 'pure black'?