Every image compressor faces the same trade-off: fidelity or file size. Lossless compression — PNG, TIFF, lossless WebP — squeezes a file by finding redundancy without discarding a single pixel value. Open it again and you get back exactly what went in. That precision costs space: a lossless PNG of a photograph is considerably larger than its JPEG equivalent.

Lossy compression throws something away. JPEG uses the Discrete Cosine Transform to convert pixel blocks into frequency data, then quietly drops the fine detail human vision is least sensitive to. Most WebP and AVIF work similarly. The result looks right even though it isn’t — at low quality you see blocking and ringing; at sensible settings the difference is invisible at a glance.

LosslessLossy
What happensPerfect reconstructionDetail is permanently discarded
FormatsPNG, TIFF, lossless WebPJPEG, most WebP/AVIF
Use whenMasters, UI, flat graphics, re-editsFinal web delivery, photographs

01The generation-loss trap

Every time you re-save a lossy file, compression runs again on data that has already been degraded — new artefacts stack on the old ones. Do it five times and the image visibly deteriorates.

75–85quality where lossy artefacts vanish
PNG/TIFFthe lossless masters to keep
1 masterwork from it, export the rest