mediacodec.dev

The chroma subsampling lab

Your eye is sharp about brightness and lazy about colour, and every video codec exploits it: colour is stored at a fraction of the resolution and almost nobody notices. This page performs that trick in front of you, on a test card built to make it visible.

Subsampling

1.5 samples/px

colour shared by 2×2 blocks; what video actually ships

View

The channel views show what each plane carries after the scheme is applied: at 4:2:0 the Cb and Cr views go visibly blocky while Y stays untouched.

4:4:44:2:0

the test card · 640×360 · drag the divider · left is the untouched original

Try your own image: drop one here, or

Files are processed in this tab and never uploaded.

What 4:2:0 actually means

An encoder does not work in RGB. It splits the picture into one luma plane (Y, the brightness) and two chroma planes (Cb and Cr, the colour differences), and then simply stores the chroma planes smaller. In 4:2:2, each pair of pixels shares one colour sample; in 4:2:0, each 2×2 block does. That cuts the raw data from 3 samples per pixel to 1.5 before the codec proper has done anything at all, and nearly every video you have ever watched shipped this way.

Why red text bleeds

The test card's white text survives every scheme untouched, because text-shaped detail in white is carried by the luma plane, which subsampling never touches. The same text in pure red lives almost entirely in the chroma planes, so at 4:2:0 its edges are averaged across 2×2 blocks and it smears. This is why screen recordings and subtitled anime look soft in the wrong places, and why screen-content encodes reach for 4:4:4 when they can afford it.

Where it is free

Flip to the photo and the trick becomes invisible: natural images have soft colour edges, and averaging soft edges changes nearly nothing. That asymmetry, huge savings on photographs, visible damage only on synthetic edges, is why 4:2:0 became the default everywhere and why the exceptions (screen capture, text overlays, chroma-keyed footage) are exactly the cases where professionals reach for more. The chroma subsampling article covers the notation and history; the even-dimensions rule on the resize page is this same 2×2 block making itself felt in FFmpeg commands.