Hacker News

Regressive JPEGs

cats

: 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 -…

Continue reading at Hacker News maurycyz.com
Advertisement