Lossy compression and chroma sampling

Capture Frame

Lossy compression and chroma sampling

Lossy image codecs shrink files by discarding detail the eye is less likely to miss. High-frequency chroma is often thinned earlier than luma. A JPEG is a cooked deliverable, not a twin of the sensor readout.

Human vision resolves fine luminance structure better than fine chromatic structure. Codecs exploit that. A common path converts RGB into a luma channel (Y) and two chroma channels (Cb, Cr), then samples chroma on a coarser grid. In 4:2:0 chroma subsampling, a 2×2 block of luma samples shares one Cb and one Cr sample. Colour detail is stored at quarter the spatial density of the luma plane before further transform coding begins.

JPEG continues with block discrete cosine transforms, quantization tables that throw away high-frequency coefficients — especially in chroma — and entropy coding. Heavy compression shows as 8×8 blocking, mosquito noise on edges, and washed or smeared colour on saturated boundaries. Those artefacts are not present in a typical RAW mosaic file; they are the price of a small interchange format.

Worked sampling count: take a 4000×3000 image. Full 4:4:4 would store 12×10⁶ Y samples and 12×10⁶ each for Cb and Cr if chroma matched luma resolution — 36×10⁶ channel samples before other packing details. With 4:2:0, Y remains 12×10⁶ while each chroma plane is about 1000×750 = 0.75×10⁶, totaling about 1.5×10⁶ chroma samples. Chroma sample count falls from 24×10⁶ to 1.5×10⁶ — a 16× reduction in chroma grid points — before DCT quantization discards still more. The eye often tolerates that; graphics with razor colour edges often do not.

The pipeline before encoding already differs from “the sensor.” Demosaic, white balance, colour matrix, tone curve, sharpening, and noise reduction reshape the data. JPEG then compresses that rendered RGB (or YCbCr). Saying the JPEG “is what the sensor saw” skips every stage. RAW keeps more of the pre-render measurements; it is still not a literal photon log, but it is closer to the capture for reprocessing.

Limits: this note does not document every JFIF marker, does not compare HEIF or AVIF bitstreams, and does not prescribe a quality slider number. It explains why chroma is discarded earlier and why a lossy deliverable is not identical to the sensor readout.

A misreading

The misreading is that JPEG always looks identical to the sensor readout. JPEG encodes a processed, often 8-bit, chroma-subsampled, quantized image. The sensor produced a mosaic of filtered samples. Between those points sit demosaic, colour, tone, and compression decisions. Identity is not guaranteed even at the highest quality setting.

Keep masters in a lightly processed or RAW form when you may re-export. Use lossy formats for delivery size. When colour edges smear, ask whether 4:2:0 and hard quantization were invited to the party — they usually were.

Terms

Luma / chroma
A brightness-like channel and two colour-difference channels used in many codecs.
4:2:0
Chroma subsampling with chroma at half resolution horizontally and vertically relative to luma.
Lossy compression
Encoding that discards information to shrink the file, ideally below visibility thresholds.
Quantization (codec)
Coarsening of transform coefficients; stronger tables discard more high-frequency detail.

Sources

  1. JPEG and related imaging standards describe YCbCr conversion, chroma subsampling, and DCT quantization.
  2. Perception literature notes lower acuity for fine chromatic detail than for luminance detail, motivating chroma thinning.
  3. This frame is conceptual capture literacy, not a codec implementation guide.

Desk authority. Compression claims are cleared by a human capture editor who compares the worked example to a standards primer and discards unverifiable references.