Advertisement

Technical Deep Dives8 min read

Choosing a Target Image Format: PNG, WebP, AVIF, JPEG and the Rest

Format conversion looks boring until a transparent PNG becomes a black JPEG. The one rule that prevents most of the damage, why lossless to lossless is free and lossy generations never undo, and what each of the six formats is genuinely for.

By · Part of the Image processing and on-device AI topic cluster

Format conversion looks like the most boring tool on the site until you convert a transparent PNG to JPEG and discover the transparency became black. Then it becomes the most interesting one for about ten minutes.

The converter reads and writes PNG, WebP, AVIF, JPEG, BMP and TIFF, takes several files at once, and runs entirely in your browser. Here is how to choose the target.

The one rule that prevents most damage

JPEG has no alpha channel.

Not "poor alpha", not "compressed alpha". None. When a transparent image is written as JPEG, every transparent pixel has to become some opaque colour, and which colour depends on the tool. Black is common. So is white. Neither is what you wanted.

So: if the image has transparency you intend to keep, the target is PNG, WebP or AVIF. If you deliberately want a flat background, add the background first as a decision, then convert. The difference between those two paths is that the first produces a surprise and the second produces a file you chose.

Lossless to lossless is free

Converting between lossless formats does not degrade the image. PNG to lossless WebP, PNG to BMP, TIFF to PNG: the pixels come out the same. The file size changes, sometimes dramatically, but nothing is thrown away.

This is why format conversion is safe to do repeatedly on masters, as long as you stay on the lossless side.

The moment you write a lossy format, that stops being true, and it stops being true permanently.

Lossy generations do not undo

A JPEG is not a picture. It is a set of instructions for approximating a picture. Decode it, edit it, re-encode it, and you approximate the approximation.

The practical consequences:

Never round-trip through JPEG for storage. If you need a JPEG for a destination that requires one, export it as a final step from a lossless master and keep the master.

Converting a JPEG to PNG does not restore anything. It freezes the artefacts you already have into a bigger file. Perfectly reasonable if you are about to edit and want to stop the decay there. Pointless if you were hoping for quality back.

Editing a JPEG repeatedly is the slow version of this problem. Each save is another generation.

What each format is actually for

PNG. Lossless, alpha, universally supported, large. The default for cutouts, logos, screenshots, anything with hard edges or text, and anything that is going to be edited again. When in doubt, PNG.

WebP. Lossless or lossy, alpha in both modes, much smaller than PNG at the same quality, supported everywhere that matters now. The best general choice for web delivery of an image with transparency. Lossy WebP with alpha is genuinely useful: the transparency stays sharp while the colour compresses.

AVIF. Smallest at a given quality, alpha supported, slower to encode. Excellent for delivery when file size is the constraint and you can afford the encode time. Check your destination accepts it, because some tools and older software still do not.

JPEG. No alpha. Still the right answer for photographic content with no transparency going somewhere that expects a photo: marketplaces, print services, anything with a strict upload filter. Small and understood by everything.

BMP. Uncompressed, enormous, no compelling modern use except feeding software that demands it. Occasionally the only thing an old application will read.

TIFF. The archival and print answer. Lossless, handles high bit depth, expected by print workflows. Large by design.

Size is not the only axis

Two images at the same file size are not equally good, and two formats at the same quality setting are not comparable, because the quality number means different things in different encoders.

The honest way to decide is to convert and look, at full size, at the part of the image you care about. Compression artefacts concentrate where there is a hard edge next to a flat area: text, logos, the boundary of a cutout. A photo of foliage can take heavy compression invisibly. A screenshot with text cannot.

If size is the whole point, use the compressor rather than the converter. Converting changes the container and the codec; compressing tunes the quality within one.

Batches

The converter takes multiple files at once, which is the difference between converting a folder of forty product shots and doing it one at a time. The important part is that the whole batch stays on your device: forty files means forty files not uploaded, not forty uploads that happen to be convenient.

For a batch, decide the target once, on a representative file, then run everything through it. Checking one converted file carefully beats skimming forty.

Nothing leaves your browser

Decoding and encoding both happen locally. There is no server that sees your images and no queue they sit in.

For this tool that is not only a privacy property, it is a speed one. There is no upload wait and no download wait, so the time you spend is the time the encoder actually takes.

A short decision tree

  1. Does the image have transparency you need to keep? If yes, never JPEG.
  2. Will this file be edited again? Choose lossless: PNG, or lossless WebP.
  3. Is this final delivery on the web? WebP, or AVIF if size matters more than encode time.
  4. Does the destination have a strict format list? Follow it, and export from a lossless master.
  5. Is it going to print or an archive? TIFF.
  6. Did you just convert a lossy file to a lossless one hoping for quality? It did not work, and that is not a bug.

Applies to NSS Background Remover v2.4.0, the release that was current when this article was published.

Was this article helpful?

Your answer is saved in this browser only. This control makes no network request and does not send the answer to an NSS feedback endpoint.

Found this useful?