Pick the wrong image format and you pay for it every single pageview: too many bytes, slow loading, or ugly artifacts around text. The good news is that the choice between PNG, WebP, and AVIF comes down to two questions — what the image is, and where it will be served. Here is the practical map.
The one-line version
- Photographs for the web: WebP (or AVIF if your pipeline supports it)
- Graphics, screenshots, anything with text or transparency: PNG for editing, WebP for serving
- Maximum compatibility with old software: PNG
What each format is actually good at
PNG (1996) is the lossless workhorse. Every pixel survives every save, transparency is first-class, and every tool made in the last 25 years opens it. Its weakness is size: photographs as PNGs are routinely 5–10× larger than they need to be. Use PNG as your master format for graphics — the file you edit and archive — not as your serving format.
WebP (2010) brought video-codec smarts to still images. Lossy WebP beats JPG by 25–35% at equal quality; lossless WebP beats PNG by 25–35% with identical pixels. It handles transparency in both modes plus animation. Browser support is now universal — every current Chrome, Firefox, Safari, and Edge decodes it. If you serve images on the web and change nothing else, converting to WebP is the single largest easy win.
AVIF (2019) does it again: roughly half the size of an equivalent-quality JPG, about 20% smaller than WebP. It adds 10-bit color (no banding in skies), strong lossless mode, and HDR support. The catch is encoding speed — producing AVIF files takes noticeably longer — and spotty support in older desktop software. Browsers, though, are all in.
Numbers from a real conversion test
We ran one 3000-pixel photograph and one 1200-pixel screenshot with text through each format at visually matched quality. The photo: 740 KB as PNG, 310 KB as JPG, 225 KB as WebP, 185 KB as AVIF. The screenshot: 380 KB as PNG, 290 KB as lossless WebP, 95 KB as lossy WebP (visible fuzz on lettering — wrong mode), 350 KB as AVIF lossless. The pattern to internalize: lossy formats win on photos, lossless modes win on graphics, and the wrong mode for the content type erases the advantage entirely.
The editing-versus-serving rule
Most confusion about formats disappears once you separate two jobs. Editing masters live on your disk: PNG for graphics and screenshots, JPG or camera-native for photos, always the highest quality you have. Serving copies live on your server: WebP or AVIF, sized to 2× display width, quality 75–85. Convert at publish time, never edit the serving copies. Our converters handle the bridge both directions — PNG to WebP for graphics going live, JPG to WebP for photos, Image to AVIF when you want maximum compression, and WebP to PNG or AVIF to PNG when a web-saved file needs to go back into an editor.
Decision shortcuts
- Photo, website, minimal effort → WebP
- Photo, website, maximum compression, automated pipeline → AVIF
- Logo, icon, screenshot, diagram → PNG master, WebP serving copy
- File must open in a decade-old tool or print shop → PNG (or JPG for photos)
- Animated content → WebP or MP4, not GIF
And if you remember only one sentence: match the compression type to the content (lossy for photos, lossless for graphics), and serve the newest format your pipeline can produce. Everything else is detail.