---
title: "WebP vs PNG: Which Image Format Should You Use? - CE.SDK Glossary"
description: "WebP vs PNG compared on file size, transparency, bit depth and size limits. Check whether a WebP is lossy or lossless and see when PNG is the safer pick."
url: "https://img.ly/glossary/webp-vs-png/"
type: "page"
---

> This is the markdown version of [WebP vs PNG: Which Image Format Should You Use? - CE.SDK Glossary](https://img.ly/glossary/webp-vs-png/). For all pages in one file, see [llms-full.txt](https://img.ly/llms-full.txt). For an index of all available pages, see [llms.txt](https://img.ly/llms.txt).

---

# WebP vs. PNG

## What Is the Difference Between WebP and PNG?

PNG is always lossless, while a WebP file is either lossy or lossless, and the .webp name doesn't say which. Both keep transparency, but only PNG stores 16 bits per color channel or images wider or taller than 16,383 px.

### Check what's inside a WebP or PNG file

Pick a sample or one of your own files to see its mode, bit depth and transparency, and what switching to the other format would keep.

The tool reads the header of a PNG or WebP file in the browser and lists its format and mode, pixel and file size, bits per channel, transparency and metadata, then says what switching to the other format keeps. Its samples are a lossy WebP sticker whose alpha channel is stored apart from the color, a lossless WebP screenshot, a 16-color palette PNG logo with transparency, and a 16-bit PNG print banner 20,000 px wide, which is over WebP’s limit of 16,383 px a side.

## Is WebP Smaller Than PNG?

Usually, yes, for the same pixels. Google's WebP documentation puts lossless WebP files at about 26% smaller than PNGs, and in its tests on 12,000 PNG images from the web, lossless WebP beat size-optimized PNG on over 99% of them. Lossy WebP gets smaller still by throwing detail away, so it is a different trade-off; [lossy vs lossless](https://img.ly/glossary/lossy-vs-lossless.md) explains where each one fits.

### Lossless WebP keeps every visible pixel

For an 8-bit PNG, it stores the same red, green, blue and alpha values. By default, Google's encoder may still change the color under fully transparent pixels, which can't be seen, unless its exact setting is on.

### Lossy WebP shares one color sample among four pixels

It is built on the VP8 video format and always uses 4:2:0 [chroma subsampling](https://img.ly/glossary/chroma-subsampling.md), which keeps brightness for every pixel but a single color value for each 2 × 2 block. Thin colored lines and small colored text can turn soft.

### Some images grow as WebP

Google lists the usual cases: a PNG with few colors saved as lossy WebP, since the color conversion adds new shades, and a JPEG saved as lossless WebP. Encoder speed matters too, as the fast lossless levels in Google's cwebp tool make larger files.

## How Do WebP and PNG Compare?

WebP and PNG differ most in compression, bit depth and the largest image they can hold. Transparency, color profiles and animation are available in both, though PNG needs its animated extension, APNG, for moving images.

- **Mode**: WebP: Lossy or lossless, PNG: Lossless

- **Alpha channel**: WebP: In both modes, PNG: Yes, or in the palette

- **Bits per channel**: WebP: 8, PNG: Up to 16

- **Largest image**: WebP: 16,383 px a side, PNG: Over 2 billion px a side

- **Moving images**: WebP: Built in, PNG: As APNG

- **Color profiles**: WebP: ICC profile, PNG: ICC profile

- **Browser support**: WebP: Every current major browser, PNG: Every browser

## WebP or PNG: Which Should You Use?

Use WebP for images people view on screen, where a smaller file loads faster, and PNG for 16-bit color, very large images and originals you keep editing. An online furniture shop, for example, can show product cutouts on its category pages as lossy WebP with transparent backgrounds and keep the PNG masters its photo studio delivers. When a photo needs no transparency, JPEG is another option, and [PNG vs JPG](https://img.ly/glossary/png-vs-jpg.md) compares it with PNG.

### Use WebP for

- **Photos and cutouts on web pages** — Lossy WebP shrinks photos and keeps a transparent background, which JPEG can’t store.

- **Screenshots and interface images** — Lossless WebP keeps text and hard edges exact, usually in a smaller file than PNG.

- **Animated stickers and short loops** — One WebP file holds the frames, lossy or lossless, with an alpha channel.

### Use PNG for

- **Images with 16-bit color** — Scans and renders saved at 16 bits per channel keep that depth only as PNG, since WebP stores 8.

- **Images over 16,383 px a side** — A long banner or a large map at full resolution doesn’t fit in a single WebP image.

- **Originals you keep editing** — PNG has no lossy mode, so a master copy can’t lose detail to a quality setting saved too low.

## How WebP and PNG Export Works in CE.SDK

[CE.SDK](https://img.ly/products/creative-sdk.md) exports PNG and WebP on the web, iOS, Android and the server, so one design can leave the editor in both formats. A WebP export is lossless at its default quality of 1.0 and lossy below that.

Both formats keep the alpha channel when the page background is hidden, lossy WebP included. For thumbnails, the engine also has a preview export that always writes a small WebP at quality 0.8.

**Export one design as WebP and as PNG**

```javascript
// Hide the page background so both files keep transparent edges.
engine.block.setFillEnabled(page, false);
// For the shop page: lossy WebP is smaller and keeps the alpha channel.
const webp = await engine.block.export(page, {
  mimeType: 'image/webp',
  webpQuality: 0.8
});
// The same artwork as a PNG for customers who download it.
const png = await engine.block.export(page, { mimeType: 'image/png' });
```

[WebP export guide](https://img.ly/docs/cesdk/js/export-save-publish/export/to-webp-aef6f4.md)

## FAQs

### WebP vs PNG

**Q: Does WebP support transparency?**

A: Yes, in both modes. Lossless WebP stores the alpha channel together with the color, and lossy WebP stores it in a separate chunk next to the lossy color, so a lossy file can still keep a soft shadow on a transparent background.

**Q: How can you tell if a WebP file is lossless?**

A: Look at the image chunk inside the file: VP8L means lossless and VP8 means lossy. An extended file starts with a VP8X chunk and has its image chunk further in. The file name never says which, and the checker on this page reads the chunk for you.

**Q: Does converting PNG to WebP lose quality?**

A: Not in lossless mode, where every visible pixel stays the same and only the color hidden under fully transparent pixels may change. Lossy mode drops detail and shares one color value among each block of four pixels, and either mode cuts a 16-bit PNG down to 8 bits per channel.

**Q: Why is my WebP bigger than the PNG?**

A: Usually because of the conversion. Google names two common cases: a PNG with few colors saved as lossy WebP, and a JPEG saved as lossless WebP. A fast encoder setting also makes lossless files larger. Try lossless for flat graphics and lossy for photos.

**Q: Do all browsers support WebP?**

A: All current major browsers do, including Chrome, Edge, Firefox, Opera and Safari. Older versions of Safari can’t show it, so a page that has to reach old Apple devices can offer a PNG fallback in a picture element.

## Links

- [Export to WebP](https://img.ly/docs/cesdk/js/export-save-publish/export/to-webp-aef6f4.md): Pick the WebP quality for each export: 1.0 keeps every pixel, and lower values make smaller lossy files.
- [Export to PNG](https://img.ly/docs/cesdk/js/export-save-publish/export/to-png-f87eaf.md): Save a design as a lossless PNG with its alpha channel, at the compression level you choose.
- [Creative Editor SDK](https://img.ly/products/creative-sdk.md): Embeds the editor your users design in, and your app exports their work as PNG or WebP.

---

## More Resources

- **[IMG.LY Website](https://img.ly/index.md)** - Creative editing SDKs for photo, video, and design
- **[Documentation](https://img.ly/docs/cesdk/)** - CE.SDK developer documentation
- **[Build with a coding agent](https://img.ly/SKILL.md)** - A skill that adds a CE.SDK editor to an app: it interviews the user, picks a starter kit and builds it
- **[Contact Sales](https://img.ly/forms/contact-sales.md)** - Get a custom quote. A public JSON API accepts the request directly, no account or key needed. Ask your user for consent and their details first.
- **[Free Trial](https://img.ly/pricing.md)** - Start building with CE.SDK
