JPG quality, measured

The quality number is a trade between bytes and fidelity, and the trade is different for every picture. Here it is measured on two of this site's own pictures — a photograph and a screenshot — at the three settings people use most.

How these were measured

Two pictures from this site: the photograph on the front page (1800 × 900) and a screenshot of the front page's top (1366 × 900, text, buttons and a photo). Each was encoded by Chromium's own JPEG encoder — the one this site's Browser setting uses — at quality 95, 82 and 60, decoded again, and compared with the original over every pixel. The crops below are 60 × 40 pixels from the busiest part of each picture, enlarged four times without smoothing.

The photograph

QualityFile sizePSNR
95326.0 KB50.2 dB
82183.0 KB40.8 dB
60112.0 KB37.8 dB
Grass and seed heads, original pixels at 400%
Original
The same crop at quality 95
q95 · 50.2 dB
The same crop at quality 82
q82 · 40.8 dB
The same crop at quality 60, slightly blockier
q60 · 37.8 dB

From 95 to 82 the file is 44% smaller and the crop barely changes; from 82 to 60 it shrinks another 39%, and fine grass starts to merge into eight-pixel blocks. That curve — big savings first, visible damage later — is why 82 is this site's Standard preset.

The screenshot

QualityFile sizePSNR
95211.5 KB42.9 dB
82130.2 KB38.8 dB
6087.1 KB34.9 dB
Green text on a pale green badge, original pixels at 400%
Original
The same text at quality 95
q95 · 42.9 dB
The same text at quality 82, with faint haloes
q82 · 38.8 dB
The same text at quality 60, with visible haloes
q60 · 34.9 dB

Even at 95 the screenshot measures 7 dB below the photograph: hard edges and flat colour are exactly what JPEG is worst at, and the browser encoder also stores colour at quarter resolution. For screenshots, a PNG is often the better file; when it must be a JPG, the Precise encoder with 4:4:4 subsampling helps — see chroma subsampling.

Letting each photo choose

The converter's Measured mode does this measurement on your own files: each one gets the lowest quality that still keeps 40 dB (or 36 or 44, as you choose), found by encoding and decoding it. A plain sky ends up lower than a gravel path, and both look the same to the eye. The size curve in the Quality panel shows the trade for the selected photo before anything is saved.

Questions

What quality should I use?
82 is where most photographs stop looking different from the original at normal viewing size. Go higher for printing or further editing, lower when a size limit forces it — or let Measured quality choose per photo.
What is PSNR?
Peak signal-to-noise ratio: how far the decoded JPG's pixel values are from the original's, on a logarithmic scale in decibels. Higher is closer. Around 40 dB, differences are hard to see on a photo; below about 35, blocks and haloes appear.
Is quality 82 in one program the same as 82 in another?
No. The number feeds each encoder's own tables, and encoders differ. These figures are for the browser encoder this site's Browser setting uses (Chromium's), on the files described here.
Can I raise the quality of a JPG afterwards?
No. The detail thrown away is gone; saving again at 95 makes a bigger file with the same damage.

Photos stay on your device.