What Happens When You Repeatedly Save a JPEG?
Repeatedly editing and saving an image in JPEG format causes continuous generation loss, progressively altering and degrading the underlying pixel values. Because JPEG relies on lossy compression, each save cycle discards subtle color and detail data through mathematical approximations. Over multiple generations, this process shifts numerical RGB values, introduces visible compression artifacts, blurs fine textures, and permanently reduces the fidelity of the image.
The JPEG Compression Pipeline
To understand how pixel values change, it is necessary to examine what happens during every save operation:
- Color Space Transformation: The image is converted from RGB to YCbCr, separating luminance (brightness, \(Y\)) from chrominance (color, \(Cb\) and \(Cr\)). The human eye is more sensitive to brightness than color, so the color channels are often downsampled (chroma subsampling), which immediately averages and permanently alters the color values of neighboring pixels.
- Discrete Cosine Transform (DCT): The image is divided into \(8\times8\) pixel blocks. A DCT is applied to each block, converting spatial pixel values into frequency components (low-frequency flat areas versus high-frequency edges and fine details).
- Quantization: This is the strictly lossy step. The frequency components are divided by values in a quantization matrix and rounded to the nearest integer. High-frequency details are rounded down to zero, deleting them entirely.
- Encoding: The remaining values are compressed losslessly into the final file.
How Pixel Values Change During Repeated Saves
When a saved JPEG is reopened, the computer reconstructs the pixels from the quantized frequency data. If the file is saved again, the cycle repeats. This leads to distinct changes in pixel values:
- Drift in Numerical Values: Because quantization relies on rounding, the calculated value of a pixel rarely matches its original input. Re-quantizing already rounded data causes values to drift further with each iteration until they eventually stabilize into coarse mathematical averages.
- Loss of High-Frequency Information: Pixel values that define sharp contrasts, textures, noise, or fine lines are smoothed out. Neighboring pixels in detailed areas are forced closer to the average value of their immediate surroundings.
- 8x8 Blocking Artifacts: Because DCT operates on rigid \(8\times8\) pixel grids, the boundary pixels of each grid diverge from the boundary pixels of adjacent grids. Over multiple saves, these differences become sharp discontinuities, manifesting as visible grid lines across the image.
- Ringing and Halos: Near high-contrast boundaries (such as dark text on a light background), high-frequency data loss causes "ringing" artifacts. Pixel values oscillate unnaturally around edges, creating visible halos.
- Color Bleeding: Chroma subsampling repeatedly averages color information across \(2\times2\) or \(4\times4\) pixel blocks. With repeated saves, distinct color boundaries spread outward into adjacent areas.
The Impact of Editing and Alignment
The severity of pixel degradation depends significantly on whether modifications shift the pixel grid. If an image is simply opened and re-saved without changes at the exact same quality setting, pixel value drift eventually plateaus after several cycles because the values already align with the quantization matrix.
However, if an image is cropped, rotated, resized, or shifted, the original \(8\times8\) block alignment is disrupted. The compression algorithm is forced to slice the image into entirely new \(8\times8\) grids. This treats previous compression artifacts as new image data, recalculating DCT frequencies from scratch and accelerating pixel degradation exponentially.
Preventing Pixel Degradation
To preserve exact pixel values throughout an editing workflow, images should be stored in lossless formats such as PNG, TIFF, or native working files (such as PSD) during production. JPEG compression should only be applied once as the final export step.