Chroma subsampling: 4:2:0 vs 4:4:4

Encoders store colour at lower resolution than brightness, because your eye barely notices. Except when it does — and then it is the reason your red text looks dirty.

The three schemes

4:4:4
No subsampling. Colour at full resolution. Largest file, required for coloured text.
4:2:2
Colour halved horizontally. A middle ground used in video and pro workflows.
4:2:0
Colour halved both ways — one colour sample per 2 × 2 pixels. The web default.
Typical saving from 4:2:0
Around 20% of the file, for no visible cost on photographs.
Where it fails
Saturated coloured text, thin coloured lines, sharp colour boundaries.
Applies to
JPEG, WebP, AVIF and video. Not PNG, which has no chroma channels.

Why it works, and when it does not

The biological fact it exploits

The human retina carries far more rod cells, which detect brightness, than cone cells, which detect colour. The practical consequence is that we resolve fine detail in brightness far better than fine detail in colour.

Encoders exploit this directly. After separating an image into one luma channel and two chroma channels, they keep luma at full resolution and store chroma at half. Three quarters of the colour data is discarded, and on a photograph you genuinely cannot see it.

Reading the notation

The three numbers describe a 4-pixel-wide reference block: how many luma samples, how many chroma samples in the top row, and how many in the bottom row.

4:4:4
Four luma, four chroma top, four chroma bottom. Nothing discarded.
4:2:2
Colour sampled at half horizontal resolution, full vertical.
4:2:0
Colour sampled at half resolution in both directions — the zero means the bottom row reuses the top row's samples.

4:2:0 is the default for web JPEG and for essentially all consumer video, which is why it is the behaviour you are almost always getting.

The failure case, in detail

Subsampling assumes colour changes slowly across the image. When it changes abruptly, the assumption breaks.

Consider red text on a white background. The boundary between red and white is instantaneous, but the encoder only has one colour sample per 2 × 2 block of pixels. Blocks straddling the edge must average red and white into a single sample, producing a muddy orange fringe along every stroke — and the thinner the text, the worse it is, because more of it is edge.

Blue on white and pure saturated lines suffer identically. This is why a screenshot of a code editor with syntax highlighting looks so poor as a JPEG: it is almost entirely thin, saturated, coloured shapes.

What to do about it

If you can control subsampling, use 4:4:4 for anything containing coloured text, interface elements or fine coloured line work, and 4:2:0 for photographs.

Most browser-based tools, including this one, do not expose the setting — a canvas encoder chooses it for you, and typically picks 4:2:0 at lower quality settings and 4:4:4 at very high ones. We would rather say that plainly than offer a control that has no effect on the output.

The practical answer is therefore the same as it always is for this content: do not use a lossy format for it. PNG and lossless WebP have no chroma channels to subsample, so the problem cannot occur. Both will usually give you a smaller and sharper file for a screenshot than any JPEG setting can.

Try it yourself

Everything below runs in your browser, so you can test any of this on your own files without uploading them.

  • Compress PNG

    Lossless by default, with transparency carried through untouched.

    Open the tool
  • Compress JPEG

    Shrink JPG and JPEG photographs with a quality slider or an exact target size.

    Open the tool
  • Compress WebP

    Re-encode existing WebP files, or convert JPEG and PNG into WebP.

    Open the tool
  • PNG to JPG

    For photographs stored in the wrong container. Transparency is flattened deliberately.

    Open the tool

Questions

Frequently asked questions

Every answer below is present in the page source, expanded, so it can be read without opening anything.

Can I choose the subsampling here?

No. The browser's canvas encoder decides it, and there is no API to override that choice — so rather than show a control that would not affect the output, this site does not offer one. If you need guaranteed 4:4:4, a desktop encoder such as MozJPEG or ImageMagick exposes the setting directly.

How much does subsampling actually save?

Roughly 20% of the file for a typical photograph, sometimes more. It is one of the cheapest savings in the whole pipeline, because for photographic content the cost really is invisible.

Does PNG use chroma subsampling?

No. PNG stores RGB directly with no luma/chroma separation, so there are no colour channels to subsample and no fringing of any kind. This is part of why PNG handles coloured text so much better.

Why does my red logo look orange at the edges?

That is chroma subsampling. The blocks straddling the boundary between the logo and the background have to average two very different colours into one sample. Raising the quality barely helps because it is a different lossy step. Save the logo as PNG or WebP instead.

Does WebP subsample too?

Lossy WebP does, using 4:2:0, and it can produce the same fringing on saturated fine detail. Lossless WebP does not, which makes it a genuine replacement for PNG on exactly this kind of content.

Is 4:4:4 worth the extra size for photographs?

Almost never. On continuous-tone photographic content the difference is genuinely invisible at normal viewing size, and you would be paying roughly 20% more bytes for it. Save 4:4:4 for graphics — or better, use a lossless format for graphics.

From the blog

Related reading

Longer, more practical guides from the blog.

  • Image Compression

    JPEG Quality Settings Explained: What the Number Actually Means

    Quality 80 is not 80% of anything. It is an index into a quantisation table. Measured on one photograph: dropping from 100 to 90 removes 77% of the file and 4.2 dB of fidelity; dropping from 40 to 30 removes 17% and costs almost as much.

    8 min read

  • Image Formats

    PNG vs JPEG: When to Use Each, With the File Sizes to Prove It

    PNG stored the same photograph in 1274.1 KB where JPEG needed 67.5 KB — nineteen times larger. On a flat graphic PNG won. On a smooth gradient PNG lost to JPEG by a factor of two, which surprises most people.

    9 min read

  • Image Formats

    WebP vs JPEG: Which Should You Use, and When JPEG Still Wins

    WebP produced a 27.0 KB file against MozJPEG's 41.1 KB on the same photograph at slightly higher measured fidelity — 34% smaller. It also produced a larger file than JPEG on random noise. The advantage is real and content-dependent.

    9 min read