How to Compress a PNG File

PNGs get heavy fast. Here's how to shrink one without wrecking the transparency or the crisp edges you kept it for.

Illustration of a large graphic file being reduced in size on a designer's desk

PNG files get big. A full-page screenshot can run several megabytes, and a large graphic with transparency can be heavier still. The PNG format is lossless, so it can't simply throw away detail the way JPG does — which means shrinking one takes a different approach, and involves a trade-off worth understanding before you click.

Compress PNG reduces the file while keeping it a PNG, transparency intact. What it trades away is colour precision, not sharpness — see below.

How PNG compression actually works

JPG shrinks a photo by discarding visual detail. The PNG format can't do that — it stores exactly the pixels it was given. So PNG compression takes a different route: it reduces the number of distinct colours in the image and encodes the result more efficiently.

That's the trade, and it's worth being clear-eyed about it: the file stays a lossless PNG, but the compressor has thrown away colour precision to get there. On a logo with eight flat colours you will never see it. On a smooth gradient or a photograph you might, in the form of visible banding where a smooth transition becomes a series of steps.

That's why results vary so much by image type. Flat-colour graphics compress well relative to photographs, because there wasn't much colour variety to throw away in the first place. A photograph saved as PNG has thousands of subtly different colours and compresses badly — which is the real clue about what's gone wrong in that case.

There's a floor to this, and it's a sensible one. If your PNG is already well optimised — a small logo with a handful of flat colours, say — re-encoding it can genuinely come out larger than the original. The tool checks for that and hands you back your original file untouched rather than a worse one. If you compress a PNG and nothing happens, that's usually why: there was nothing left to win.

If it's a photo, stop compressing and convert

The most effective PNG optimisation is often not to use PNG. If your file is photographic, PNG is the wrong container and no amount of compression fixes that — PNG to JPG will typically cut the size substantially, with little visible difference on photographic content. Our guide on converting PNG to JPG covers when that's the right call and the one case where it definitely isn't.

The exception is transparency. JPG has no alpha channel, so if your image has a transparent background, converting to JPG fills it with solid colour. In that case, keep it PNG and compress — or consider PNG to WebP, which keeps full transparency and usually beats PNG on file size comfortably. WebP's only real drawback is that a few older tools and upload forms still won't accept it.

Resize before you compress

The most reliable way to shrink any image is to stop storing pixels nobody sees. A 3000px-wide screenshot displayed in a 700px column is wasting most of its bytes. Resize Image to the size it's actually displayed at, then compress — the combination beats either step alone by a wide margin.

Illustration of a designer at a standing desk before a wall of pinned flat icon posters

Where PNG genuinely earns its size

Don't optimise a PNG out of existence when it's doing a real job. Keep it for:

  • Screenshots of text and UI — JPG's compression makes small type fuzzy; PNG keeps it crisp.
  • Logos, icons, and flat-colour graphics — sharp edges stay sharp, and these compress well anyway.
  • Anything needing a transparent background.
  • Working files you'll re-edit — PNG never degrades across saves.

FAQ

Does compressing a PNG lose quality?
It can. PNG compression typically reduces the colour palette, which is invisible on flat graphics but can cause visible banding on gradients or photographic content.

Will my transparent background survive?
Yes — compressing a PNG keeps it a PNG, alpha channel included. Converting to JPG is what destroys transparency.

Why is my PNG still huge after compressing?
Usually because it's a photograph — PNG has very little room to compress photographic content, so convert it to JPG or WebP instead. The other possibility is that it was already well optimised, in which case the tool returns your original rather than handing back a file that got bigger.

← Back to all guides