How-to

How to Reduce PNG File Size Without Losing Quality

Is your PNG too heavy — slowing down a page or refusing to fit in an email? Good news: most of the time you can shrink it by 60–70% without a single eye noticing the difference. Here is the step-by-step playbook — what to do right now, with which tools, and how far you can realistically get.

A website wireframe and a smartphone on a desk — lighter PNGs load faster
Heavy PNGs are one of the most common causes of slow websites — and one of the easiest to fix. Photo: Pexels

Why PNGs get so heavy

To compress well, you first need the cause. PNG uses lossless compression: it is obliged to keep every pixel exactly as it was drawn. That is its superpower — perfectly sharp edges, text and logos — and also its weakness.

Lossless compression works best where there is repetition: flat fills, simple icons, UI screenshots. A photograph or a smooth gradient, on the other hand, is millions of subtly different shades with almost nothing to collapse. That is why a photo saved as PNG can weigh 5–10 times more than the same photo as JPG.

There are also three classic "weight gainers" that are easy to remove:

  • Excessive bit depth. A ten-color icon is often saved as a full-color PNG-24/32 (16.7 million colors), when a 256-color palette would do.
  • Metadata. Editors stitch the date, software name, an ICC color profile, sometimes XMP and a thumbnail into the file. For a screenshot, those are wasted bytes.
  • Oversized resolution. A 4,000 px-wide image displayed at 800 px on a page carries five times more data than it needs.

In short

A PNG is heavy not because it is "bad" but because it is honest — it stores everything down to the last pixel. Our job is to remove what the eye does not need: surplus colors, housekeeping data, and excess resolution.

Two paths: lossless optimization vs quantization

Every way to shrink a PNG falls into one of two camps. Understanding the difference is half the battle, because your choice decides how much weight the file actually loses.

Path 1. Lossless optimization

The tool changes not a single pixel. It only tries different row filters and repacks the data with a more efficient DEFLATE/Zopfli algorithm, while dropping unnecessary chunks. The result is pixel-for-pixel identical to the original. Savings are more modest — typically 10–25% — but completely safe. These are optipng, oxipng and zopflipng.

Path 2. Palette quantization (lossy)

The tool reduces the number of colors to a palette (256 max) and turns a PNG-24/32 into a compact PNG-8. This is technically "lossy," but smart algorithms pick the palette and add dithering so cleverly that on typical graphics the difference is invisible. The payoff is huge — 60–70%. These are pngquant and online services like TinyPNG.

The pro move: quantize first (−60–70%), then run a lossless pass on top (−a few more percent). That stacks both wins together.
60–70%savings from quantization (pngquant/TinyPNG)
10–25%savings from lossless (optipng/zopfli)
256colors in a PNG-8 palette

The fastest way: online, in 30 seconds

If you would rather not install software or wrestle with a command line, do it in the browser. The most effective trick for the web is not just to compress the PNG, but to re-save it as WebP. Lossless WebP is about 26% smaller than PNG and fully preserves transparency.

1

Upload the PNG

Drag your file (or several at once) into the online PNG → WebP converter. Nothing to install — files are processed right in the browser.

2

Get WebP

The converter re-saves the image as WebP and keeps the alpha channel. You get a smaller file at the same visual quality.

3

Download the result

Drop the file onto your site. For older browsers you can keep a PNG fallback via the <picture> tag.

Need transparency and maximum compatibility with everything? Then stay in PNG, but run the file through a quantizer. And if transparency does not matter and it is a photo — look at the PNG → JPG converter: it will compress the shot far harder.

Compress your PNG right now

The free FormatZ converter re-saves your PNG as a lightweight WebP in a couple of seconds — in the browser, with no install and no sign-up. Transparency is preserved.

Compress PNG to WebP
A web designer's workstation with two screens — image optimization speeds up loading
One pass through an optimizer saves more bandwidth than weeks of hand-tuning your layout. Photo: Pexels

Pro tools: pngquant, optipng, oxipng

If you optimize dozens of files or want to bake compression into your build, the command line is more comfortable. Here is the working set and the exact role of each tool.

pngquant — quantization (the main win)

The most effective tool. It reduces colors to a palette and, on average, cuts the file by roughly 64% at high visual quality. The --quality flag sets an acceptable range: if it cannot stay within it, the file is not re-saved.

# one file → result is image-fs8.png next to the original
pngquant --quality=65-85 image.png

# overwrite every PNG in the folder in place
pngquant --quality=65-85 --ext .png --force *.png

optipng / oxipng — the lossless finisher

Run these after pngquant to squeeze out a few more percent completely safely. optipng is the classic; oxipng is its modern Rust rewrite: multithreaded, faster, and often a tighter compressor. The -strip flag also clears out metadata.

# optipng: maximum level + strip metadata
optipng -o7 -strip all image.png

# oxipng: fast, multithreaded, with stripping
oxipng -o max --strip safe image.png

zopflipng — when you need the smallest file

It uses Google's Zopfli algorithm: it compresses tighter than almost everything else (winning in roughly 87% of cases) but runs noticeably longer. Ideal for a final build where time is not critical and every kilobyte counts.

zopflipng --iterations=60 image.png image-min.png

Tip: build a pipeline

A "pngquant → oxipng" chain in a single script gives the best balance of size and quality. On a batch of icons and UI graphics this reliably means −70% in weight — with no visible degradation.

What about metadata?

Stripping housekeeping chunks (date, software name, XMP, sometimes the ICC profile) is a separate, small lever. For an ordinary screenshot it saves only a couple of kilobytes, but if the editor embedded a heavy ICC profile or XMP block, you can shave off 5–15 KB. The same optipng/oxipng (the -strip flag) or ImageMagick handle it.

Careful with color

If the file has a meaningful ICC profile (for print, say, or a wide color gamut), a full -strip all can shift colors on color-managed screens. For the web this is usually safe; for print use --strip safe or keep the profile.

PNG-8 vs PNG-24: the difference

When people say "convert PNG to PNG-8," they mean quantization. The difference between the modes is the key to understanding why the file shrinks so dramatically.

PropertyPNG-8 (palette)PNG-24 / 32 (truecolor)
Number of colorsup to 256up to 16.7M
File sizeSmallLarge
TransparencyYes (incl. semi-transparency*)Full (alpha channel)
Best forIcons, logos, UI, flat graphicsPhotos, complex gradients
Lossy?Yes (quantization)No

* Modern quantizers (pngquant, TinyPNG) can preserve smooth semi-transparency in PNG-8, not just the on/off transparency of older editors.

The takeaway is simple: send icons, logos and UI screenshots straight to PNG-8 — you will not see the loss, and the file shrinks several times over. But do not squeeze a photo or an image with subtle gradients into 256 colors: you will get visible "banding." For those, switching to WebP or JPG is the better call.

Interface sketches, pencils and a smartphone on a designer's desk
Flat graphics and UI elements are perfect candidates for PNG-8: 256 colors are more than enough. Photo: Pexels

When to switch to WebP or JPG

Sometimes the most honest way to reduce a PNG is to stop using PNG. Not for everything — but for many jobs another format simply does better.

  • WebP — the web default. Losslessly it is about 26% smaller than PNG at identical quality, supports transparency and animation, and runs in 96%+ of browsers. For logos, icons and UI it is almost always the right call. The fastest route is the PNG → WebP converter.
  • JPG — for photos without transparency. A photo saved as PNG is almost always overkill. JPG compresses the same photo 5–10 times harder. One catch: no transparency (transparent areas turn white). The tool is the PNG → JPG converter.
  • AVIF — the cutting edge. It compresses about 10% tighter than WebP, but support is a touch narrower. A good option with a PNG/WebP fallback for your heaviest images.
  • Keep PNG. If you need absolute pixel precision and compatibility with everything (print, email, legacy software) — PNG, but always run through an optimizer first.

Rule of thumb

Transparency + a website → WebP. A photo without transparency → JPG. Sharp graphics / logo / print → PNG (optimized). That covers 95% of real cases.

Checklist: shrink a PNG in 5 minutes

A short algorithm that works almost every time. Go top to bottom and stop wherever the result satisfies you.

  • Is it a photo without transparency? → convert to JPG (PNG → JPG) and you are done.
  • Is it graphics for the web? → re-save as WebP (PNG → WebP) — about −26% for free.
  • Do you really need PNG? → run it through a quantizer (pngquant / TinyPNG) — −60–70%.
  • Finish losslessly. → optipng/oxipng with -strip — a few more percent and goodbye metadata.
  • Check the resolution. → if the image is larger than it is displayed, downscale before compressing — this often beats every optimizer combined.
  • Compare by eye. → open the original and the result side by side. Can't tell them apart? Then you did it right.

Want to convert in bulk or try other formats? The full list of conversions lives on the FormatZ all formats page.

The best optimization is the kind you can't see. If the file got twice as light and the picture still looks the same — you won.
Yes. Lossless optimizers (optipng, oxipng, zopflipng) repack the data with a more efficient algorithm and drop unnecessary chunks — every pixel stays identical, and you typically save 10–25%. If you can accept a tiny color trade-off, palette quantization (pngquant, TinyPNG) saves 60–70% while looking virtually unchanged to the eye.
PNG uses lossless compression, so it stores every pixel exactly. For photos and gradients that produces huge files — there is little to collapse. Size is also inflated by excessive bit depth (24/32-bit instead of a palette), embedded metadata and ICC profiles, and resolution that is larger than the image is ever displayed.
pngquant is lossy quantization: it reduces colors to a palette (PNG-8), which cuts the file by 60–70%. optipng is a lossless optimizer: it leaves colors untouched and only picks better filters and compresses the DEFLATE stream harder, saving another 10–15%. They are often run in sequence — pngquant first, then optipng.
Yes. Quantizers like pngquant and TinyPNG preserve semi-transparency (the alpha channel) in a palette PNG. Lossless optimizers never touch transparency at all. Switching to WebP also fully supports the alpha channel, unlike JPG, which has no transparency.
For the web, WebP is usually the move: at the same quality it is about 26% smaller than lossless PNG and is supported by 96%+ of browsers. Choose JPG for photos without transparency — it compresses them far harder than PNG. Keep PNG for logos, icons, screenshots and graphics with sharp edges where precision and transparency matter.