Image Compressor topic guide

Transparent image format: PNG vs WebP vs AVIF for alpha

Direct answer

PNG is the safest format for transparent images because it is lossless, carries an alpha channel and is supported by every browser and image tool ever made. WebP also supports transparency in both lossy and lossless modes, and produces a smaller file than PNG at comparable quality — but not every non-browser tool reads WebP yet. AVIF supports transparency too and compresses even smaller than WebP for complex images, but encoding is slower. JPEG cannot carry transparency at all: any transparent source saved as JPEG is composited on a solid background before the file is written. Use PNG when you need maximum compatibility or lossless transparency; use WebP when you want a smaller file for web delivery; use AVIF when you need the smallest possible file for a hero image with alpha.

Try the Image Compressor

What this workflow handles

The decision has two axes: whether you need transparency at all, and whether the destination is a website or something else. If the destination is email, print or a marketplace upload, PNG is usually the only safe choice — most email clients and print pipelines do not decode WebP or AVIF reliably. If the destination is a website, WebP lossy with alpha is the practical default because it produces a much smaller file than PNG and every modern browser reads it. AVIF lossy with alpha is even smaller but encoding is slower and older tools may not open it. MDN's format guide, the WHATWG HTML Living Standard and the Pillow documentation are the canonical references for what each format can and cannot do.

Use the image compressor to re-encode a single image in its original format at the same pixel dimensions, then compare the byte counts in the result panel before keeping the output.

How to use it

  1. Check whether the image actually needs transparency — a logo on a coloured background, a UI element on a page, or a product shot on a tile.
  2. If the destination is email, print or a marketplace upload, save as PNG — it is the only format that works reliably everywhere.
  3. If the destination is a website, save as WebP lossy with alpha for the best balance of file size and browser support.
  4. If the image is a hero photograph with transparency and you need the smallest possible file, save as AVIF lossy with alpha.
  5. Keep a PNG fallback for old browsers and non-web destinations — reference both files from a <picture> element on a website.

Frequently asked questions

Can JPEG have a transparent background?

No. JPEG does not support an alpha channel at all. Any image saved as JPEG that had transparency in the source will be composited on a solid background — usually white — before the JPEG is written. MDN's Image file type and format guide lists transparency as a capability that JPEG explicitly does not have. If you need transparency, use PNG, WebP or AVIF.

Is PNG or WebP better for transparent images?

PNG is safer because it is lossless and supported everywhere, but the file is larger. WebP lossy with alpha produces a much smaller file and every modern browser reads it — Chrome, Firefox, Edge and Safari since version 14. Use PNG when you need pixel-perfect transparency (logos, UI assets) or the destination is not a website (email, print). Use WebP lossy with alpha when the destination is a website and file size matters more than pixel-perfect fidelity.

Does WebP support transparency?

Yes. WebP supports an alpha channel in both lossy and lossless modes. WebP lossy with alpha is the practical choice for web delivery because the file is much smaller than PNG and every modern browser reads it. WebP lossless with alpha preserves every pixel exactly, like PNG, but the file is usually smaller. MDN's WebP documentation confirms alpha-channel support in both modes.

Does AVIF support transparency?

Yes. AVIF supports an alpha channel in both lossy and lossless modes. AVIF lossy with alpha is usually the smallest option for a transparent image on the web, but encoding is slower than WebP and not every non-browser tool reads AVIF yet. MDN's AVIF documentation confirms alpha-channel support. Use AVIF for hero images and product shots where the smallest file justifies the slower encode.

Why does my transparent PNG have a white background after converting to JPEG?

Because JPEG does not support transparency. When a transparent image is saved as JPEG, the encoder composites the image onto a solid background — typically white — and then compresses the result. The transparency is gone and cannot be recovered from the JPEG file. To keep transparency, save as PNG (lossless), WebP (lossy or lossless with alpha) or AVIF (lossy or lossless with alpha) instead.

Explore the image compressor topic cluster

Each guide answers a different image-decision question. Pick the one that matches your situation, then use the linked tool to produce the output you need.

Related guides

  • JPEG vs PNG vs WebP: how to choose the right image format

    JPEG, PNG and WebP are not interchangeable. The right choice depends on what is in the image, whether it needs transparency, the file-size budget, and where the image will be displayed. A practical decision guide backed by MDN, Google Developers, web.dev, the WHATWG HTML Living Standard and the Pillow documentation.

All image compressor guides