Photos and files · 5 min read

JPEG, PNG, WebP or AVIF: choosing an image format

Four formats, four jobs. A short guide to picking the right one, and the one mistake that quietly ruins a photo library.

By Hasnain Butt Akhtar, founder and developer ·

Most people pick an image format by accident, using whatever their camera or their software produced. That is fine until a website loads slowly, a logo has a white box behind it, or a client cannot open the file you sent. Each of these four formats is genuinely better than the others at something specific.

The short version

FormatBest forAvoid it for
JPEGPhotographs that need to open anywhere, on anythingLogos, screenshots, anything needing transparency
PNGScreenshots, logos, diagrams, anything with flat colour, sharp edges or transparencyPhotographs, where the files become enormous
WebPPhotographs and graphics on a website, where size mattersFiles you need to email or hand to someone else
AVIFWebsite photographs where you want the smallest possible fileAnything that has to open in older software

If you only remember one line: JPEG for sharing photos, PNG for anything with text or transparency, WebP or AVIF for your website.

Why photographs and graphics want different things

This is the distinction that explains almost everything else, and it is not complicated.

A photograph is made of gradual changes. Skin tones blend, skies fade, shadows soften. Formats built for photographs take advantage of that by throwing away detail your eye does not notice, which makes the file much smaller. That is what lossy means, and on a photograph it works beautifully.

A screenshot or a logo is the opposite. It has large areas of identical colour and hard edges, especially around text. Apply photographic compression to that and the edges pick up a faint haze, which is exactly where your eye is looking. Formats built for graphics keep every pixel precisely, which is what lossless means, and because there is so much repetition the file stays small anyway.

Put a photograph in PNG and you get a file five or ten times larger than it needs to be. Put a screenshot of text in JPEG and you get visible mess around every letter. Both mistakes are common and both are avoidable by asking one question: is this mostly a photograph, or mostly a picture of something on a screen?

What the newer formats actually save

WebP and AVIF both do the same job as JPEG, more efficiently, because they are built on much newer compression research.

In practice, at a quality most people cannot tell apart from the original, WebP files tend to land around a quarter to a third smaller than the equivalent JPEG. AVIF usually goes further again, often around half the size of the JPEG, and it holds up better at low quality settings where JPEG starts to look blocky.

Those are typical figures rather than promises. The saving depends heavily on the picture. A busy, detailed photograph compresses less well in any format than a simple one with large smooth areas, and at very high quality settings the gap between all three narrows considerably. If the numbers matter to you, convert a few of your own representative images and compare, rather than trusting anyone's average.

AVIF has one practical cost worth knowing about: it takes noticeably longer to create. For a handful of images that is irrelevant. For a batch of several thousand it is the difference between minutes and an hour, so it is worth testing on a small batch first.

When compatibility should decide it

Browsers handle all four formats now, so for a website the question is settled and you should use WebP or AVIF. Everywhere else, it is worth thinking for a second.

Email is the usual trap. Attach an AVIF file and there is a reasonable chance the person receiving it cannot open it without installing something, particularly on a work machine where they cannot install anything. The same applies to older versions of office software, some printing services, older photo frames and televisions, and plenty of specialist software that has not been updated in years.

The rule that avoids all of it: use the modern formats for things you publish, and JPEG or PNG for things you hand to a person. Nobody has ever been unable to open a JPEG.

The mistake worth avoiding

Lossy formats lose a little quality every time they are saved. Not just the first time. Every time.

Open a JPEG, crop it, save it, open it again next month, adjust the brightness, save it again, and you have compressed an already compressed image twice over. Each pass throws away a bit more, and it never comes back. Do this a dozen times over a few years and the picture visibly degrades, which is why old family photos that have been through several rounds of editing often look worse than the originals nobody touched.

The habit that prevents it is simple. Keep your original file untouched, edit a copy, and export from the original each time rather than editing the export. If your camera can save in a lossless or raw format and you have the space, that original is worth keeping for anything you care about.

This is also the reason not to convert an entire photo library to a smaller lossy format to save disk space. You free up some room today and permanently lower the quality of every photograph you own. If space is the problem, a second drive costs less than the pictures are worth.

A sensible default set-up

  1. Camera and phone originals. Leave them exactly as they are. Do not convert them in bulk. Back them up.
  2. Editing. Work on copies, and export a fresh file from the original each time rather than re-saving an export.
  3. Website images. WebP as the sensible default, AVIF if you want the smallest files and do not mind the slower conversion. Around quality 80 for WebP is the usual sweet spot, but check a few of your own images rather than taking a number on trust.
  4. Screenshots, logos and diagrams. PNG, always, unless you are putting them on a website, in which case lossless WebP does the same job in a smaller file.
  5. Sending to another person. JPEG for photographs, PNG for anything else, unless you know what they are opening it with.

One last thing that costs nothing. Strip location data from images before you publish them. Photos from a phone frequently carry the exact coordinates where they were taken, and most conversion tools will remove that for you if you ask. It is easy to forget until a picture of your own front garden is on the internet with a map reference attached.

Software mentioned in this guide

Everything above works the same whichever software you choose.

More guides

All guides · Windows catalogue · About the studio