Skip to content
Image7 min read

We Measured What Image Formats Actually Cost

Short answer

There is no format that is smallest for everything. On these samples AVIF was smallest at quality 75 in four cases out of five, but for hard-edged text and flat colour the real answer was lossless WebP, which beat every lossy encoder by a wide margin — 5.8 KB against 74 KB for JPEG at quality 75. Match the format to what is in the picture, not to a general ranking.

Published

What we measured, and how

Five images, 800×600, each built to isolate one thing codecs handle differently. Every one is generated from a fixed seed by a script in this repository, so the corpus is reproducible and there is no licensing question hanging over it.

Each sample was encoded to JPEG, WebP and AVIF at qualities 50, 65, 75, 85, 95, plus PNG and lossless WebP. We recorded the encoded size and the mean SSIM against the original: mean SSIM, luma plane, 8×8 windows at stride 4, C1=(0.01·255)², C2=(0.03·255)².

Encoder: libvips 8.18.3 via sharp 0.35.3, on Node v22.15.0. That matters for one reason worth being upfront about — FileTools360's own converters run WebAssembly builds in your browser, not this Node pipeline. Same codecs and same settings, different host, so treat these as the shape of the answer rather than a byte-for-byte promise about the tool pages.

Measured 2026-09-12.

  • Smooth gradient — Continuous tone with no detail — the easiest thing to compress, and where banding shows first.
  • Hard-edged text and UI — High-contrast edges. This is where JPEG's ringing artefacts appear and where PNG wins.
  • Film-like noise — Random detail. Incompressible by design — the worst case for every lossy codec.
  • Flat colour blocks — Large areas of one colour — a logo or a chart. Lossless formats should crush this.
  • Soft alpha edge — A transparent gradient. JPEG cannot store it at all, which is the single most common reason a conversion surprises someone.

File sizes at quality 75

Quality 75 is where most people ship, so it is the fairest single comparison. Sizes are what the encoder wrote.

Two results are worth stopping on. On hard-edged text, JPEG at quality 75 produced 74 KB — larger than the 87 KB PNG, and more than ten times the 5.8 KB lossless WebP. Lossy compression is not just worse-looking on sharp edges, it is bigger. And on flat colour, lossless WebP came in at 140 B, against 4.6 KB for JPEG.

The opposite case is noise. Random detail is incompressible, so the PNG ran to 1089 KB and the lossy encoders all landed near 164 KB. If your image is grainy, lossless is the wrong tool.

Encoded size by format, quality 75
SamplePNG (lossless)WebP (lossless)JPEG q75WebP q75AVIF q75
Smooth gradient331 KB4.9 KB9.4 KB3.3 KB3.5 KB
Hard-edged text and UI87 KB5.8 KB74 KB41 KB37 KB
Film-like noise1089 KB865 KB164 KB166 KB201 KB
Flat colour blocks4.9 KB140 B4.6 KB1.5 KB751 B
Soft alpha edge56 KB27 KB10 KB36 KB1.9 KB

How much was actually lost

Size alone proves nothing — any encoder can be small if it is allowed to be wrong. SSIM scores structural similarity to the original, where 1.0000 is identical.

Read the alpha row with suspicion, and this is the useful lesson in the whole exercise. JPEG cannot store transparency at all, so that sample had to be flattened onto white before JPEG could touch it, and the comparison is made against the same flattened reference. SSIM therefore reports a comfortable score for an encode that silently threw away the one property the image existed to demonstrate. A metric answers the question you asked it, not the question you meant.

Mean SSIM against the original, quality 75
SampleJPEG q75WebP q75AVIF q75
Smooth gradient0.99260.99210.9950
Hard-edged text and UI0.97790.99800.9998
Film-like noise0.93570.98280.9910
Flat colour blocks0.99700.99731.0000
Soft alpha edge0.99270.99720.9985

What raising the quality setting buys

On a smooth gradient — the easiest thing to compress — the quality slider moves the file size a long way and the visible result very little, until the top of the range where it moves the size sharply.

From q50 to q95, JPEG goes from 4.6 KB to 34 KB. The practical advice people give — stay in the 75–85 band — holds up here.

One caveat on this sample specifically: SSIM under-reports banding, which is the artefact smooth gradients actually suffer from. The numbers below are honest about size and optimistic about gradient quality.

Smooth gradient: size across the quality sweep
QualityJPEGWebPAVIF
q504.6 KB2.7 KB2.1 KB
q658.3 KB3.3 KB2.8 KB
q759.4 KB3.3 KB3.5 KB
q8512 KB5.1 KB4.6 KB
q9534 KB10.0 KB22 KB

What this does not tell you

These samples are synthetic on purpose, because each one isolates a property and therefore explains something. A photograph is a mixture of all of them, so it will land somewhere between these rows — the corpus predicts the shape of the answer, not your exact ratio.

Encoder versions matter, and every encoder here is a specific build named above. AVIF in particular has improved substantially between releases, and a different libaom or a different effort setting will move its numbers more than the others.

Nothing here measures decode speed, encode time, or browser support. AVIF was frequently the smallest and is also the slowest to encode, which is a real trade-off on a phone and is not visible in a size column.

Reproducing this

Clone the repository and run `npx tsx scripts/seo/format-benchmark.ts`. It writes `docs/seo/data/format-benchmark.json`, which is what this page reads — the tables above are that file, formatted. If your numbers differ from ours, the encoder build is the first thing to compare.

The SSIM implementation is in the same script rather than pulled from a package, so the method is inspectable next to the results.

Sources

Try it

FAQ

Related questions

Which image format is smallest?

It depends on what is in the image, which is why this page exists. At quality 75 on our samples AVIF was smallest four times out of five — but for hard-edged text and flat colour, lossless WebP beat every lossy encoder, at 5.8 KB against JPEG's 74 KB. A general ranking of formats is the wrong question; match the format to the content.

Why is my JPEG bigger than the PNG it came from?

Because JPEG is built for photographic gradients and your image probably is not one. On our text sample JPEG at quality 75 wrote 74 KB where the PNG was 87 KB. Screenshots, logos, charts and anything with text are exactly the cases where converting to JPEG costs you quality and size at the same time.

Should I use AVIF?

For photographs on a site whose visitors have current browsers, it is usually the smallest of these at a given quality. It is also the slowest to encode, and its results move more between encoder versions than JPEG's or WebP's. WebP is the safer default; AVIF is the one to reach for when size genuinely matters.

Are these numbers from FileTools360's own converters?

No, and that distinction is deliberate. These were encoded with libvips 8.18.3 via sharp 0.35.3 in Node. The site's converters use WebAssembly builds of the same codecs running in your browser. Same settings, different host — close, but we are not going to present one as a measurement of the other.

Runs entirely in your browser

FileTools360 by the numbers

522 converters and tools65 file formatsnothing ever uploaded.