Skip to content
Tech News
← Back to articles

Regressive JPEGs

read original more articles
Why This Matters

The concept of regressive JPEGs introduces a new way to optimize image loading by enabling partial image display through layered scans, which can significantly improve user experience on slow networks. This approach enhances the efficiency of image transmission and rendering, potentially influencing future image compression standards and web performance strategies.

Key Takeaways

Regressive JPEGs:

2026-07-17

One of the cool features of JPEG files is that there's the option to save low frequency components first. This means that a partially downloaded image will be displayed at low resolution instead of being cut off.

In the file, this works by breaking up the compressed data into multiple "scans", each prefixed with a header. Here's the first scan of a representive image:

FF DA - "start of scan" marker 00 0C - Big endian length field (12 bytes) Includes itself 03 - Number of channels in scan (3) 01 - Global id of first included channel 00 - Huffman table index #1 (DC: 0, AC: 0) 02 - Global id of second included channel 10 - Huffman table index #2 (DC: 1, AC: 0) 03 - Global id of third included channel 10 - Huffman table index #2 (DC: 0, AC: 0) 00 - Starting DCT bin (DC) 00 - Ending DCT bin (also DC) 01 - Precision: half, no pre-existing data. f8ad 512d d3f1 cd96 - Huffman coded DCT coefficients bcb0 58df 53d5 5d97 [...and a lot more]

... this one includes the lowest (DC) Fourier bin for all three color channels.

The three color channels are YCbCr instead of the usual RGB. The luminance (Y) seperated because it must be high quality, but the color can be fudged quite a bit while looking fine.

Very roughly: Y = G, Cb = B - G, Cr = R - G

After it, the file contains eight more scans to fill in the rest of the data:

... continue reading