What it is
JPEG divides a picture into eight-by-eight blocks, transforms each block into a set of frequency coefficients, and then divides those coefficients by numbers taken from a table before rounding them. The quality setting chooses the table. A high setting divides by small numbers and keeps most of the detail; a low setting divides by large ones and rounds most of the fine structure to zero.
That is the whole mechanism, and it explains both of the format’s habits. Loss lands on high-frequency detail first, which is why a face survives what a page of text does not. And because the rounding happens per block, a picture pushed too far shows its block grid rather than degrading smoothly.
Where it opens
The rows below are about software a file will actually be handed to, not about a specification. A format is supported when the person you sent it to can open it.
| Where | What happens |
|---|---|
| Every browser | Opens everywhere, and has since before any of them were named. |
| Windows and macOS, out of the box | Opens in the file viewer, the mail client and the print dialog with nothing installed. |
| Email clients | The only image format no mail client has ever had an opinion about. |
| Print workflows | Accepted by every layout and print-ordering system, though a lossless source is better where one exists. |
| Anything expecting transparency | There is no alpha channel. Transparent pixels become whatever colour was painted behind them. |
What it costs to write
Native to every browser here: a 12-megapixel photograph writes in tens of milliseconds, which is why this bench can search seven settings for it without anyone noticing.
Where it goes wrong
- Every save is another pass through the encoder. Open, edit, save, repeat, and the loss accumulates in a way no later save can undo.
- Chroma subsampling throws away colour resolution in a way that shows on saturated red text and thin coloured lines long before it shows on a face.
- Flat areas band. A gradient sky that looked smooth at quality 95 can show steps at quality 80 while the rest of the picture looks untouched.
- A CMYK JPEG, which some print software writes, decodes with its colours inverted in more than one browser.
When this is the right answer
A photograph that has to be opened by software you do not control. A file going to a print shop, an insurance form, a mail client of unknown vintage, or anyone whose computer you have never seen. There is no format with a longer tail of support and there will not be one for a long time.
It is the wrong answer for anything drawn — screenshots, charts, logos, line art — and for anything that needs transparency, which it cannot store at all.
Questions about JPEG
Is quality 80 in one encoder the same as quality 80 in another?
What does chroma subsampling do?
Does opening and saving a JPEG damage it?
Why is my JPEG bigger after this bench encoded it?
What happens to a transparent picture saved as JPEG?
Encoding happens on this machine; the file stays where it is.