Effects of Repeated JPEG Quantization

Repeatedly saving a JPEG file triggers a cumulative degradation process known as generation loss, driven primarily by repeated quantization. Each time an image is opened, modified, and re-saved as a JPEG, the mathematical rounding of image frequency data introduces permanent errors. This article explains how quantization works during compression, the visual artifacts that emerge over successive saves, and why the rate of degradation changes depending on your workflow settings.

How Quantization Works in JPEG Compression

JPEG compression relies on the Discrete Cosine Transform (DCT) to convert spatial pixel data into frequency components. Human vision is far more sensitive to subtle variations in broad areas (low frequencies) than to rapid changes in fine detail (high frequencies).

Quantization is the lossy stage of this process:

  1. The 8x8 pixel blocks transformed by DCT produce frequency coefficients.
  2. These coefficients are divided by values defined in a quantization table.
  3. The resulting values are rounded to the nearest integer.
  4. Higher-frequency values, often reduced to zero, are discarded during entropy encoding.

Because rounding is mathematically irreversible, the discarded data cannot be recovered when the file is decompressed for viewing.

What Happens During Repeated Quantization

When you open a JPEG, edit it, and save it again, the software decompresses the image into raw RGB pixels and then re-applies the compression algorithm. This leads to several compounding effects:

1. Cumulative Rounding Errors

When the reconstructed pixels are converted back into frequency coefficients, the values rarely match the original numbers precisely. Re-dividing and re-rounding these slightly shifted numbers drops additional data with each cycle, compounding errors across the image.

2. Visible Image Artifacts

As quantization repeats, specific visual flaws become increasingly severe:

3. Degradation Under Identical Settings

If an unedited JPEG is repeatedly saved using the exact same software, compression level, and quantization table, the degradation does not continue indefinitely. After several iterations, the coefficient values stabilize—meaning dividing by the same matrix and rounding yields the same integers. At this point, generational loss levels off, provided the 8x8 grid alignment has not changed.

4. Severe Loss Under Changed Settings or Cropping

Degradation accelerates drastically if parameters change between saves:

How to Prevent Quantization Loss

To avoid generation loss, keep images in a lossless working format—such as PNG, TIFF, or native project formats like PSD—throughout the editing process. JPEG should only be used as a final export format once all modifications and resizing are complete. For operations that only require rotation, cropping, or metadata updates, specialized lossless JPEG tools can manipulate the underlying DCT blocks without re-quantizing the image.