The score
Every lossy result on this site is compared with its source by multi-scale structural similarity (MSSIM): local means, variances and covariances of luma, plus a lightly weighted chroma term, at three scales. Identical pictures score 1.0000. Both sides are first painted onto the same background colour, so a transparent pixel cannot read as black on one side and white on the other.
The score is computed on copies scaled so the long edge is 512 px. That keeps its cost the same for a 1-megapixel screenshot and a 48-megapixel photo — which is what lets the search below run seven times per format in a phone’s browser — and it is why every card prints the score with its basis: “0.9912 at 512 px”. The figure is a fact about that comparison, not a property of the file.
The search
For each lossy format the encoder’s own quality parameter is searched, never assumed. The first probe is the ceiling (0.98); if that already misses the target, the card says “missed the bar” and reports the score it reached. Otherwise the setting is bisected between 0.30 and 0.98, at most 7 encodes in all, stopping when the bracket is narrower than 0.01. The lowest setting that still clears the target is kept, and the setting printed on the card is the one the search landed on.
Lossless outputs — PNG, and WebP when it is written lossless — are encoded once and still measured, so the claim “lossless” is checked rather than asserted.
The thresholds
| Position | Must reach | What it asks for |
|---|---|---|
| Visually identical | 0.990 | The search stops at the lowest setting that still measures 0.990 or better against your file. |
| Very close | 0.980 | A little structure is given up where the picture is busiest. 0.980 or better. |
| Smaller matters more | 0.960 | Visible on a hard edge if you go looking. 0.960 or better, and the smallest files. |
How they were calibrated
A smooth synthetic landscape and the same landscape with 60,000 single-pixel highlights were encoded across the quality range with this browser-encoder path and scored with this site’s metric. A lossless PNG round trip through the same path scored 1.000000.
| Setting | Smooth · JPEG | Smooth · WebP | Grained · JPEG | Grained · WebP |
|---|---|---|---|---|
| 0.98 | 0.99923 | 0.99894 | 0.99758 | 0.99770 |
| 0.92 | 0.99906 | 0.99873 | 0.98806 | 0.99603 |
| 0.85 | 0.99879 | 0.99823 | 0.96851 | 0.98937 |
| 0.75 | 0.99848 | 0.99780 | 0.93998 | 0.97488 |
| 0.60 | 0.99739 | 0.99778 | 0.91294 | 0.96443 |
| 0.30 | 0.99393 | 0.99604 | 0.89862 | 0.94232 |
Two things follow. The metric depends strongly on content — the same score means a different setting on grain than on a smooth gradient — and a bar above 0.990 is unreachable on grain at any setting, which is why the top position is 0.990 and not 0.995.
Not yet done: the same calibration on a corpus of real, licensed photographs. Until it is published here, read the positions as calibrated on synthetic pictures only.
What 512 px cannot see, and the crop check
Scaling to 512 px averages away fine grain, one-pixel coloured text and chroma bleeding — exactly where JPEG and lossy WebP do their quietest damage on a large picture. So when an output is longer than 768 px on its long edge, a second score is computed on a 512 × 512 crop taken at full resolution from the busiest part of the picture (the region with the most edge energy on the scoring copy).
The Result panel shows that crop score beside the global one, and marks it when it sits more than 0.005 below — a sign that detail the 512 px score smoothed over has been lost. The search itself still runs on the 512 px score; the crop check is a warning, not a second target.
Drawn or photographed
Two statistics on the scoring copy decide whether a picture is drawn (a screenshot, chart, logo or line art): fewer than 2,200 distinct colours at 5 bits per channel, and more than 1.2% of pixels on a hard luma edge. Both must agree. A drawn picture rules JPEG out of the recommendation and gets lossless WebP when WebP is written; a photograph gets lossy encoders. Getting this wrong changes which format is recommended, never what the numbers say.
Lossless WebP is written by this site’s own encoder (the subtract-green transform, a colour cache and LZ77 references, one set of prefix codes), because a browser canvas only writes lossy WebP. Every file it writes is decoded again and scored before it is offered.
The recommendation, in order
- Transparency comes first: a format that cannot hold the alpha in your file is never recommended, whatever it did to the byte count.
- A drawn picture — few colours, hard edges — is judged on lossless candidates, and JPEG is marked as the wrong tool for it.
- A newer format has to be more than 15% smaller than a more widely readable one to be worth the support cost; inside that margin the older format wins and the cost in bytes is stated.
- If a destination is set, its constraint outranks every byte count on the page.
- If nothing beats the file you opened, the recommendation is to keep it and encode nothing.
- On a route that fixes the output, your choice is honoured; when the measurement disagrees, its answer is printed beside the result as advice and never applied for you.
The support margin is 15%. Every rule that fired for a file is listed under its result, in the order it was applied.
The output checks
Before any Save button is enabled, the file that will be downloaded is read back:
- its first bytes are the signature of the format promised;
- the size in its header is the size shown on the page;
- a file that should keep transparency declares it, and a JPEG was flattened onto the chosen colour;
- it carries no GPS block;
- the browser decodes it once more, at that size;
- renames keep a SHA-256 identical to the original; PDFs keep every embedded JPEG’s SHA-256; icons have the directory asked for.
Re-deriving the numbers
The fixtures the tests use are drawn by scripts in the repository (no stock photographs), and the metric, the search and the rules are plain TypeScript with unit tests. Encoding times vary by device; scores for the same encoder build and the same input do not.