JPEG, PNG or WebP: which image format should you use?
Three formats cover almost everything on the web, and choosing between them is mostly about one question: does this image have sharp edges and flat colour, or does it have gradual tone? Get that right and the file is both smaller and better looking. Get it wrong and you either waste bandwidth or ship something visibly damaged.
JPEG: photographs, and nothing else
JPEG is lossy and tuned for continuous tone. It discards detail the eye is least likely to miss, which works beautifully on photographs and badly on anything with hard edges — text, logos, screenshots, line art. Around sharp boundaries it produces ringing artefacts, the faint halo you see on a screenshot someone saved as a JPEG. It also has no transparency at all.
PNG: screenshots, logos, transparency
PNG is lossless, so a pixel comes back exactly as it went in and re-saving costs nothing. That makes it right for screenshots, interface elements, diagrams, anything with text in it and anything needing an alpha channel. The trade is size: a photograph saved as PNG is typically several times larger than the same photograph as a well-tuned JPEG, for no visible benefit.
WebP: the default in 2026
WebP does both jobs. It has a lossy mode that beats JPEG at similar quality, a lossless mode that beats PNG, and it supports transparency and animation. Browser support stopped being a real concern years ago. For anything going on the web, WebP is the sensible starting point, and the main reason to pick something else is a recipient or a system that specifically demands otherwise.
The quality slider is not a percentage
Quality 80 is not "80% as good" and it is not the same number between encoders. What is consistent is the shape of the curve: from 100 down to about 80 the file shrinks a great deal for very little visible change, and below about 60 the artefacts arrive fast while the savings taper off. Somewhere around 75 to 85 is where most photographs belong. Judge it by looking, not by the number.
Generation loss: the mistake that compounds
Every save of a lossy format re-compresses what was already compressed, and the damage accumulates. Open a JPEG, crop it, save it, open it again, adjust it, save it again, and each pass throws away a little more — this is why an image that has been round a group chat a few times looks like it has been through a photocopier. Raising the quality slider afterwards cannot recover any of it. Keep the original, always edit from that, and export a compressed copy at the end rather than editing the compressed copy.
Resize before you compress
The single biggest saving is usually dimensional, not algorithmic. A 4000-pixel-wide photo displayed in a 800-pixel column is carrying twenty-five times more pixels than it can show. Resize to roughly the size it will actually be displayed at — twice that for high-density screens — and then compress. Doing it the other way round wastes most of the compression effort on pixels that get thrown away anyway.