Why Low JPEG Quality Zeros High-Frequency Data

JPEG compression reduces file size by discarding visual details that the human eye struggles to perceive, a process governed by the Discrete Cosine Transform (DCT) and quantization. When an image is saved at low quality, the compression algorithm aggressively increases the divisor values in the quantization matrix. Because high-frequency components—representing fine details and sharp edges—naturally have low amplitudes in most natural images, dividing them by these massive quantization steps forces the resulting values below 0.5, rounding them completely to zero.

The Frequency Domain and the DCT

JPEG begins by dividing an image into 8x8 pixel blocks and applying the Discrete Cosine Transform to each block. This mathematical operation converts spatial pixel data into frequency components:

In most natural images, adjacent pixels share similar colors, meaning most of the visual energy concentrates in the low-frequency coefficients. Consequently, high-frequency coefficients naturally start with small numerical values.

How Quantization Works

Quantization is the only lossy step in the JPEG pipeline. Each of the 64 DCT coefficients is divided by a corresponding value in an 8x8 quantization matrix, and the result is rounded to the nearest integer:

\[\text{Quantized Value} = \text{round}\left(\frac{\text{DCT Coefficient}}{\text{Quantization Step}}\right)\]

The human visual system is far less sensitive to fine, high-frequency details than it is to smooth, low-frequency variations. Standard quantization tables are designed around this biological trait, meaning the baseline divisor for high frequencies is already significantly larger than for low frequencies.

The Impact of Low Quality Settings

When an image is exported at a low quality setting (such as 10% or 20%), the encoder scales up the entire quantization matrix using a quality multiplier:

  1. Massive Divisors: Low-frequency divisors grow moderately, but high-frequency divisors balloon into very large numbers.
  2. Fractional Quotients: Because the original high-frequency DCT coefficients are typically small numbers to begin with (for example, values between 2 and 20), dividing them by a heavily scaled divisor (such as 50, 80, or 120) yields quotients well under 0.5.
  3. Rounding to Zero: Rounding any quotient between -0.49 and 0.49 produces an exact zero.

Why Zeros Matter for Compression

Once quantized, the 8x8 block is read in a zigzag pattern starting from the low frequencies down to the high frequencies. By turning nearly all high-frequency coefficients into zeros, the algorithm creates long continuous runs of zero values at the end of the block.

These long sequences of zeros are compressed with extreme efficiency using Run-Length Encoding (RLE) and Huffman coding. While this drastic zeroing yields tiny file sizes, it also causes the familiar artifacts of low-quality JPEGs: blurred textures, ringing around sharp edges, and prominent block boundaries.