DEV Community

Cover image for πŸ•ΈοΈ PNG to WebP: Smaller files, same pixels β€” the easiest page-speed win there is
Tomaz
Tomaz

Posted on Originally published at tooladda.online

πŸ•ΈοΈ PNG to WebP: Smaller files, same pixels β€” the easiest page-speed win there is

⚑ 10-second version

WebP does everything PNG does β€” including transparency β€” in a substantially smaller file. Drop your PNGs into tooladda.online/png-to-webp.html, pick lossless or lossy, download a ZIP.

❗ Important

Batch-converting a whole site's image folder means uploading it nowhere. Everything runs in your browser, so a 200-file conversion costs you no bandwidth.


πŸš€ Why this is the single cheapest performance fix

Images are usually the heaviest thing on a web page β€” heavier than your JavaScript, by a lot. And WebP was designed specifically to beat both PNG and JPEG:

Source WebP mode Typical saving Quality
PNG (logo, icon, screenshot) Lossless ~25–35% smaller 🟒 Pixel-identical
PNG (photograph) Lossy q80–85 60–80% smaller 🟒 Visually indistinguishable
PNG with transparency Either Similar savings 🟒 Alpha fully preserved

Lossless WebP is the free lunch. Same pixels, byte for byte, roughly a quarter to a third smaller. There is no visual trade-off to weigh β€” you just get a smaller file. For logos, icons, UI screenshots and diagrams, this is the correct default.

Which mode for which image

Logo / icon / diagram / screenshot   β†’  LOSSLESS   (identical, ~30% smaller)
Photograph / hero image / thumbnail  β†’  LOSSY q82  (much smaller, looks the same)
Transparent product cut-out          β†’  LOSSLESS   (keeps clean alpha edges)
Enter fullscreen mode Exit fullscreen mode

Serve it properly

WebP has broad browser support now, but the safe pattern is still to let the browser choose:

<picture>
  <source srcset="hero.webp" type="image/webp">
  <img src="hero.png" alt="…" width="1200" height="630">
</picture>
Enter fullscreen mode Exit fullscreen mode

Browsers that understand WebP take the small file; anything else falls back. And always set width and height β€” that's what stops layout shift, which is a separate Core Web Vitals problem no format change will fix.

πŸ’‘ Tip

Before converting, ask whether the image is larger than it's displayed. A 2400 px PNG shown in an 800 px column wastes three quarters of its pixels. Resize first, then convert β€” the combination beats either step alone by a wide margin.


🧭 How it works

Diagram


✨ What's inside

### 🎚️ Lossless **and** lossy Choose per job rather than accepting one hidden default. Lossless for graphics, lossy for photos β€” the distinction that decides whether you're trading anything at all. ### πŸ”² Transparency intact Alpha channels survive conversion cleanly, so cut-outs and icons don't come back with white boxes or fringed edges.
### πŸ“¦ Batch to ZIP Convert an entire assets folder in one pass. This is a tool you run once against a whole site. ### πŸ“Š Real byte comparison See the before and after size per file, so you know what the change actually bought you.

πŸ› οΈ Real jobs

Situation Mode
🌐 Site failing a PageSpeed audit Lossless for UI, lossy for photos
πŸ›’ Product catalogue images Lossy q82, resized to display width first
🎨 Icon and logo set Lossless β€” identical output, smaller files
πŸ“± App or PWA assets Lossless, alpha preserved
πŸ“§ Emailing a batch of screenshots Lossless, much smaller attachment
πŸ’Ύ Shrinking an image archive Lossless if it must stay exact

πŸ“– Four steps

1.  Resize  β†’  first, if the images are bigger than they're displayed
2.  Open    β†’  tooladda.online/png-to-webp.html
3.  Mode    β†’  lossless for graphics, lossy ~82 for photos
4.  Export  β†’  ZIP, then serve with a <picture> fallback
Enter fullscreen mode Exit fullscreen mode

β–Ά Convert now β€” tooladda.online/png-to-webp.html


❓ FAQ

Is it free?

Free, no watermark, no signup, no batch limit beyond your device's memory.

Is lossless WebP really identical to my PNG?

Yes β€” pixel for pixel, in a smaller file. That's why it's the default recommendation for graphics.

Does WebP support transparency?

Yes, full alpha, in both lossless and lossy modes.

Do all browsers support WebP?

Support is broad across current browsers. Use a <picture> element with a PNG fallback if you need to cover very old clients.

WebP or AVIF?

AVIF usually compresses even harder; WebP has wider support and encodes faster. Many sites serve AVIF first, WebP second, original last.

Are my images uploaded?

No β€” conversion runs in your browser.


πŸ”¬ Under the hood

  • Encoding via the browser's native WebP encoder on a canvas; no server, no queue.
  • Lossless and lossy paths exposed separately rather than collapsed into one quality slider.
  • Alpha channel carried through; batch queued with a client-side ZIP.
  • Works offline once loaded.

Originally published on ToolAdda, where PNG to WebP runs free in your browser β€” nothing is uploaded, nothing leaves your device.

Top comments (0)