Patu

Graphics aren't photos: where lossless wins

“Convert everything to AVIF” is good advice for photographs and quietly bad advice for everything else. A screenshot, a logo, a chart, a UI mockup, a line drawing — these are graphics, not photos, and the lossy codecs that make AVIF and JPEG so good at photos are the wrong tool for them.

Why lossy codecs fail on graphics

JPEG, WebP-lossy and AVIF are built for photographs: smooth gradients, natural texture, no hard edges. They work by discarding high-frequency detail the eye won’t miss in a photo. Point them at a graphic and that same machinery turns against you:

A graphic has few colours and hard structure. The right move is to keep it exact and compress the redundancy, not to throw detail away.

The numbers, on real graphics

We ran the graphic set from our benchmark — 213 real graphics (logos, charts, UI, flat-colour art) — through the tools built for them, measuring the saving against the original PNG:

Tool Kind Median saving vs original PNG
oxipng lossless (byte-exact) −29%
cwebp -lossless lossless (byte-exact) −49%
pngquant lossy palette (near-exact) −71%

Lossless WebP cuts these graphics roughly in half and every pixel is identical. oxipng re-optimizes the PNG itself with no format change — safe everywhere. pngquant goes furthest by reducing the palette; on flat-colour art the result is visually indistinguishable, on a photo it would be a disaster. Which is the whole point: the tool has to match the content.

The rule: classify first, then compress

The mistake isn’t picking WebP or picking PNG. It’s picking one codec for everything. A pipeline that ships web images well has to look at each asset and decide what it is before deciding how to compress it:

This is what Patu does: it classifies each image and routes it. A graphic is kept lossless — re-encoded exactly, not blurred into a lossy format that’s both larger and worse. A photo gets the quality-targeted lossy search. Same endpoint, opposite treatment, because they’re opposite problems.

The headline advice survives with one word added: convert your photos to AVIF. Convert your graphics to the smallest lossless form. Sending both down the same pipe is how you end up with fuzzy logos and heavier files at once.


Method and data: the Patu benchmark harness over the graphic category (213 real graphics); savings are the median reduction against the original PNG, per tool. oxipng and lossless WebP are byte-exact; pngquant is lossy palette reduction, near-exact on flat-colour content.