Chroma subsampling: 4:2:0 against 4:4:4

A JPEG keeps brightness and colour separately, and usually stores colour at a quarter of the resolution. On a photograph nobody notices. On coloured text, everybody does.

What the numbers mean

The encoder converts each pixel to brightness (Y) and two colour-difference channels (Cb, Cr). With 4:4:4 all three are kept at full resolution. With 4:2:0 the two colour channels are halved in both directions, so one colour value is shared by a 2 × 2 block of pixels. Brightness — where the eye sees detail — stays sharp; colour edges blur by a pixel, which on a thin red stroke is the whole stroke.

Measured

The same two pictures as in JPG quality, measured, encoded by this site's Precise encoder (MozJPEG) at quality 82, progressive, once at 4:2:0 and once at 4:4:4.

Picture4:2:04:4:44:4:4 costs
Photograph149.9 KB · 41.2 dB191.1 KB · 42.2 dB+28% bytes
Screenshot101.7 KB · 36.2 dB112.3 KB · 36.8 dB+10% bytes
Green text on a pale green badge, original, at 400%
Screenshot, original
The same text at 4:2:0, thin strokes washed towards grey
4:2:0
The same text at 4:4:4, colour staying inside the letters
4:4:4
Grass and seed heads, original, at 400%
Photograph, original
The same grass at 4:2:0
4:2:0
The same grass at 4:4:4
4:4:4

On the photograph, 4:4:4 costs 28% more bytes for 1 dB; on the screenshot, 10% more bytes keeps the green lettering green, where 4:2:0 washes the thin strokes towards grey and leaves a pale fringe beside them. The cost depends on how much colour detail a picture has, which is why the Auto setting measures each one: a large share of flat colour or saturated red on hard edges picks 4:4:4, everything else 4:2:0.

Choosing it here

In the converter's Quality panel, set Encoder to Precise. Subsampling then offers Auto, 4:2:0 and 4:4:4; the preview, the size curve and the written file all use the same choice, and the row reads back which one the file carries.

Questions

Which should I use?
4:2:0 for photographs: the eye does not miss the colour detail and the file is smaller. 4:4:4 for screenshots, diagrams, logos and anything with small coloured text or saturated red edges. The Precise encoder's Auto setting measures each picture and picks one.
Why is there no 4:2:2 option?
The MozJPEG build this site uses sets one subsampling factor for both directions, so it writes 4:2:0 or 4:4:4. 4:2:2 sits between them and is rarely the right answer for either kind of picture.
Which does the Browser encoder use?
Chromium's encoder wrote 4:2:0 at quality 95, 82 and 60 in these tests, and 4:4:4 at 100; other browsers decide for themselves. Each written file is read back, and the Quality panel shows which one it carries.
Is a 4:4:4 JPG less compatible?
No. Every JPEG decoder reads it. It is simply larger.

Photos stay on your device.