Images & Video

JPEG, PNG, WebP or AVIF: picking the right image format

Saving a screenshot as JPEG makes the text fuzzy. Saving a photo as PNG makes the file eight times larger. Both mistakes come from the same gap in knowledge.

4 minute read

Image formats are not interchangeable containers for the same thing. Each one made a different bet about what kind of picture it would hold, and using the wrong one costs you either file size or visual quality, sometimes both.

The short version

Format Compression Transparency Best for Avoid for
JPEG Lossy No Photographs Text, screenshots, line art
PNG Lossless Yes Screenshots, logos, UI, line art Photographs
WebP Both Yes Almost everything on the web Print handoff, archival masters
AVIF Both Yes Web photos where size matters most Fast batch encoding, older software
SVG Vector Yes Logos, icons, diagrams Photographs

JPEG: built for photographs, hostile to edges

JPEG splits the image into 8×8 pixel blocks, converts each to frequency information, and discards the high-frequency detail your eye is least likely to miss. It also usually throws away three-quarters of the colour resolution, a technique called chroma subsampling, because human vision is far more sensitive to brightness than to colour.

That set of assumptions is excellent for a photograph of a face or a landscape, where colour changes gradually. It is actively bad for a screenshot, where a hard black-on-white edge is exactly the high-frequency detail JPEG is designed to throw away. The result is the coloured fringing and mosquito noise you see around text in a JPEG screenshot.

JPEG also has no transparency. Ever. If something must sit on a coloured background, JPEG cannot do it.

PNG: lossless, transparent, and heavy on photos

PNG predicts each pixel from its neighbours, stores the difference, and compresses the result with DEFLATE. Nothing is discarded, decode a PNG and you get the exact original pixels back.

That is perfect for content with large flat areas and sharp edges: screenshots, logos, icons, charts, anything with text. It is a poor fit for photographs, where no two adjacent pixels are alike and the prediction has nothing to work with. A photo saved as PNG is routinely five to ten times larger than the same photo as a good-quality JPEG, with no visible benefit.

PNG also supports a full 8-bit alpha channel, which is why it remains the safe choice for a logo that has to sit on an unknown background.

One nuance: PNG-8 uses a 256-colour palette and can be dramatically smaller than PNG-24 for simple graphics. For a flat-colour logo, it is often the right answer.

WebP: the sensible default for the web

WebP does both lossy and lossless, supports alpha transparency in both modes, and typically produces files around 25–35% smaller than JPEG at comparable perceptual quality. Crucially, it supports transparency with lossy compression, something neither JPEG nor PNG can do, which makes it excellent for a photographic image with a cut-out background.

Browser support stopped being a concern years ago; every current browser handles it, including Safari. The remaining friction is outside the browser: some older desktop software, printers and corporate document systems still do not accept it.

Use WebP for images on your website. Do not use it as the file you email to a client or send to a printer.

AVIF: smaller still, at a cost

AVIF uses the intra-frame coding from the AV1 video codec. At low-to-medium quality settings it is meaningfully smaller than WebP, often another 20% or more, and it degrades more gracefully, producing soft blur rather than blocky artefacts. It also handles 10- and 12-bit colour and wide gamut, which matters for HDR content.

The trade-offs are real: encoding is significantly slower than JPEG or WebP, support in non-browser software is patchier, and at very high quality settings the size advantage narrows.

Use it for hero images and large photographs on a site where bandwidth matters, and serve a WebP or JPEG fallback.

Choosing, in practice

Does it have text, sharp edges or flat colour? → PNG (or SVG if it started as vector).

Is it a photograph? → WebP for the web, JPEG for anything that has to be opened by arbitrary software.

Does it need a transparent background? → PNG for compatibility, WebP if it is photographic and web-only.

Is it a logo, icon or diagram you have the vector source for? → SVG. It stays sharp at any size and is usually a few kilobytes.

Is it going to a printer or a client's design team? → Whatever they asked for, at the highest quality you have. Do not optimise files you are handing over as source material.

Converting without a round trip

Format conversion is decode-then-re-encode, which browsers do natively with the Canvas API and modern codecs. NextTool's image converter and compressor run entirely on your device, so a batch of holiday photos or client mockups never gets uploaded anywhere.

One rule regardless of tool: always convert from the highest-quality original you have. Converting a JPEG to WebP inherits every artefact the JPEG already had, then adds its own.

Further reading

Do it hereConvert Image FormatsConvert images to PNG, JPG or WebP, one at a time or in a batchOpen

Written for NextTool. Every statement about a tool is checked against that tool's code, and corrections are dated above. How guides are written

formatsjpegpngwebpavif