Why Progressive JPEGs Have Smaller File Sizes
Progressive JPEG images often produce smaller file sizes than sequential JPEGs because of how their image data is grouped, structured, and compressed. While sequential JPEGs decode an image block by block from top to bottom in a single pass, progressive JPEGs deliver the image in multiple full-frame passes of increasing detail. This architectural difference allows progressive encoders to group similar frequency data together across the entire image, leading to significantly more efficient entropy encoding and run-length compression.
Better Statistical Grouping for Huffman Coding
JPEG compression relies on Huffman coding, an entropy encoding algorithm that assigns shorter binary codes to frequently occurring data values and longer codes to rarer ones.
In a standard sequential JPEG, the encoder processes the image in 8x8 pixel blocks. For every single block, it encodes the DC coefficient (the average color) followed immediately by all 63 AC coefficients (the high-frequency details and textures). Because high-frequency and low-frequency data are constantly interleaved from block to block, the data distribution fluctuates rapidly.
In contrast, a progressive JPEG splits the image into distinct scans. A typical progressive scan might transmit only the DC coefficients for the entire image in the first pass, followed by low-frequency AC coefficients in the next pass, and high-frequency AC coefficients in subsequent passes. Grouping identical frequency bands together creates much more uniform statistical distributions within each scan. This uniformity allows the Huffman encoder to generate tighter, more optimal prefix codes, reducing the total number of bits required to store the data.
Efficient Run-Length Encoding of High Frequencies
Most photographic images contain significant areas of flat or smoothly transitioning color, such as skies, blurred backgrounds, or solid surfaces. In the frequency domain, these areas contain large sequences of zero-value AC coefficients.
JPEG uses Run-Length Encoding (RLE) to compress these consecutive zeros. In progressive JPEGs, grouping high-frequency coefficients across the entire image results in massive, uninterrupted sequences of zeros. The encoder can represent these empty high-frequency regions with compact end-of-block markers and long zero-run codes far more efficiently than a sequential JPEG, which must reset its run-length counters for every individual 8x8 block.
Successive Approximation
Progressive JPEGs also support successive approximation, where the most significant bits of the coefficients are sent first, and the least significant bits are refined in later passes. Isolating the lower-order bits into separate bit-plane scans removes noise from the initial passes and creates highly compressible, predictable bit patterns in later scans, further boosting overall compression ratios.
The Threshold for Size Reduction
While progressive encoding typically saves between 2% and 10% in file size on medium-to-large images, it is not universally smaller for every image. Progressive JPEGs require additional header markers and scan scripts to define how each pass is structured. For very small images (typically under 10 kilobytes), this structural overhead can outweigh the compression gains, making a sequential JPEG slightly smaller. For standard web photographs, however, the statistical gains of grouped entropy coding consistently make progressive JPEGs the lighter choice.