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.
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.