How small can a photo become before we notice the difference?

Eleven measured JPEG settings for one 512×512 photo span 8,293–99,308 bytes. Compare images, zoom into details and examine error maps. Objective metrics are not human detection thresholds.

Compression is not merely shrinking a file: it is a decision about which information to discard. We encode one NASA public-domain photo (the scikit-image astronaut sample) at eleven JPEG settings. Explore the visible differences yourself; this study does not measure human detection thresholds.

Look first, then read the numbers

OriginalJPEG

Left: original; right: JPEG

File size27,748 B
Bits per pixel0.847
PSNR32.06 dB
SSIM0.9202
Mean absolute error3.93
Original detail (4×)
Original crop
JPEG detail (4×)
JPEG crop

Error map: mean absolute RGB-channel error; fixed scale 0–40 levels, saturated above 40.

RGB absolute error

0 — 20 — ≥40

Figure 1 | Actual software experiment. Every image is the same input or its decoded JPEG. Error maps are not visual sensitivity maps. Use arrow keys to operate sliders.

Methods

The input is the 512×512, 8-bit RGB astronaut sample (NASA, public domain). Python 3.13.5, Pillow 12.3.0, NumPy 2.3.5, scikit-image 0.26.0 and JPEG codec version 6.2 were used. Chroma subsampling was fixed to 4:2:0 (subsampling=2), progressive=False and optimize=False; each JPEG was encoded independently from the original. PSNR uses peak 255; SSIM uses the RGB channel mean, a 7×7 window and data_range=255, not a calibrated perceptual model. File sizes include JPEG container overhead. One deterministic sample per setting; no random process.PSNR=10 log10(255²/MSE), where MSE averages all RGB pixel channels.

Results

Changing quality from 95 to 50 reduces 99,308 B to 27,748 B, a 72.1% saving. PSNR falls from 38.28 to 32.06 dB and SSIM from 0.9700 to 0.9202. Quality 5 occupies only 8,293 B (1.05% of raw RGB bytes), but SSIM is 0.6501. SSIM decreases slightly from quality 60 to 70 (0.9274 to 0.9250), illustrating that individual quality metrics need not be strictly monotonic.

QBbppPSNR (dB)SSIMMAE
58,2930.25324.110.650111.41
1011,5640.35326.840.81207.73
2016,6780.50929.310.87445.48
3020,9120.63830.540.89764.73
4024,4210.74531.400.89964.33
5027,7480.84732.060.92023.93
6031,2880.95532.710.92743.67
7036,8001.12333.520.92503.42
8045,9601.40334.670.94582.95
9068,0522.07736.690.96032.37
9599,3083.03138.280.97001.95

Discussion and limitations

JPEG quantization suppresses high-frequency information, and coarse quantization can produce blocking or ringing around edges and textures. Chroma subsampling also affects color detail. PSNR measures pixel error; SSIM compares local structure. Neither proves invisibility. One image, one encoder and fixed subsampling limit generalization. There are no human observers, controlled viewing distances, display conditions or population confidence intervals.

Conclusion

Quality 50 substantially reduces storage for this example, but cannot be called visually lossless on these data. Choose settings according to image content, application and inspection; no universal threshold is established.

Data, code and licensing

The full CSV, environment record, reproduction code and static results are included. The NASA photo is public domain; newly authored text and figures use CC BY 4.0.

CSV · Environment · Python source · Complete static results

References

  1. Wang, Z., Bovik, A. C., Sheikh, H. R., & Simoncelli, E. P. (2004). Image quality assessment: from error visibility to structural similarity. IEEE TIP 13(4), 600–612. DOI: 10.1109/TIP.2003.819861.
  2. scikit-image 0.26 data API: astronaut (NASA public domain); metrics API.
  3. Pillow Handbook: JPEG image file format.