PNG is a lossless format, so it is easy to assume a PNG is already as small as it can be. It usually is not. The format leaves the encoder a lot of choices about how to pack the pixels, and most software makes those choices quickly rather than well. A screenshot tool has to save the instant you press the key; a design app exporting fifty icons does not want to spend a second on each. The result is files that are often a quarter larger than they need to be - with not one pixel different from the smallest version.
That gap is what a lossless optimiser closes, and it is what the Compress PNG tool does in your browser. This guide explains where the wasted bytes come from, what to expect, and when lossless is the wrong goal.
Where the wasted bytes in a PNG come from
A PNG is compressed in two stages. First each row of pixels is run through a filter - a reversible trick that replaces each value with its difference from a neighbour, so a smooth gradient turns into a long run of small, repetitive numbers. Then the filtered rows are squeezed with deflate, the same compression a zip file uses. Both stages have options:
- Filters. There are five, and the best one can differ row by row. A fast encoder often picks one filter for the whole image, or uses a cheap guess.
- Deflate effort. Deflate can search harder for repeated patterns. Fast encoders use a low effort setting so the save feels instant.
- Pixel format. A PNG can store full RGBA (4 bytes a pixel), RGB (3), greyscale, or an indexed palette of up to 256 colours (1 byte or less). A screenshot of a web page that only uses 180 distinct colours is often saved as RGBA anyway, carrying four bytes of data where one would do.
- Bit depth. A two-colour diagram can be stored at 1 bit per pixel. Most apps write 8.
- Metadata. Text comments, a creation timestamp, and sometimes an eXIf block with camera details or location ride along in the file.
None of these choices affects how the image looks. That is the whole point: an optimiser tries many combinations, decodes nothing differently, and keeps whichever version comes out smallest.
How to compress a PNG losslessly
- Open Compress PNG and drop in one or more PNG files. Nothing is uploaded - the optimiser runs in a background worker inside your browser tab.
- Pick an effort level. Fast, Better and Best are oxipng levels 2, 3 and 4. Every one of them is lossless; higher levels simply try more filter and compression combinations.
- Leave Remove metadata ticked unless you need the text chunks. Colour chunks such as an ICC profile, sRGB or gamma are always kept, because dropping them can shift colours on a colour-managed screen.
- Press Compress PNG. Each file shows its old and new size and the percentage saved. Download them one by one, or use Download all as ZIP for a batch.
If a file cannot be made any smaller, the tool tells you it is already optimal and gives you back the original rather than a rewritten copy of the same size. Animated PNGs are detected and left alone, so an animation is never broken by a still-image optimiser.
A worked example: how much smaller does it get?
Here are two real files run through the same optimiser that powers the tool. The first is this site's own social-sharing image, a 1200 x 630 graphic exported straight from a renderer. The second is an illustration that had clearly been optimised before.
- Social card: 79,049 bytes to 60,152 bytes on Fast - 23.9% smaller in about half a second. Best got it to 56,765 bytes, 28.2% smaller, but took 2.4 seconds, nearly five times as long.
- Pre-optimised illustration: 23,940 bytes on Fast, exactly the same size - nothing left to win. Best found 2.2% (23,410 bytes) after a full second of trying.
That pattern is typical. The first pass captures most of the gain on a poorly packed file, the higher levels add a few percent at several times the cost, and a file that has already been through an optimiser has little or nothing left. Use Fast for batches, and Best for a single hero image you are about to put on a website, where every kilobyte is served thousands of times.
The biggest wins come from the pixel-format change. A 1920 x 1080 screenshot holds 2,073,600 pixels. Stored as RGBA that is 8,294,400 bytes of raw data before compression; stored as a palette it is 2,073,600 - a quarter of the input to deflate, before deflate has even started. Flat-colour images like UI screenshots, charts, diagrams and logos often have few enough colours for this, which is why they shrink far more than photographs saved as PNG.
The transparent-pixel option
A pixel that is fully transparent still stores a red, green and blue value - you just cannot see it. Editors often leave whatever colour was there before it was erased, which is noise to the compressor. Ticking the clean-up option lets the optimiser rewrite those hidden values to whatever packs best. The image looks identical on every screen, because alpha zero means nothing is drawn. It is off by default only because the raw data is no longer bit-for-bit identical; if you plan to edit the alpha channel later and bring those pixels back into view, leave it off.
When lossless is the wrong goal
Lossless optimisation has a ceiling: it can only remove inefficiency, never information. For a photograph saved as a PNG, that ceiling is low - a 5 MB camera photo might lose 5%, still leaving a huge file. Photos are noisy, every pixel is slightly different from its neighbour, and PNG was never designed for them.
If you need a photo to fit an upload limit, convert it to JPG or WebP in the image compressor, or hit an exact size with compress image to size. Those give up some invisible detail and routinely save 80-90%. Keep PNG for what it is good at - screenshots, text, line art, logos and anything with transparency - and run those through the optimiser before you publish them.
Quick checklist before you publish a PNG
- Resize first. Halving the width and height quarters the pixel count, which no optimiser can match - use the image resizer if the image is bigger than it will be displayed.
- Is it a photo? Use JPG or WebP instead.
- Is it a screenshot, chart or logo? Run it through Compress PNG on Fast, or Best for a one-off.
- Remove metadata unless you need it - it can include where and when the image was made.
Frequently asked questions
- Will compressing a PNG make it blurry?
- Not with lossless optimisation. The file decodes to exactly the same pixels as before - only the way they are packed into the file changes. Blurriness comes from lossy compression or from resizing, and this kind of compression does neither.
- Why did my PNG not get any smaller?
- Because it was already well packed. Files saved by image optimisers, some design tools and many websites have already had their filters, compression and colour format tuned, so there is nothing left to remove without changing pixels. In that case the tool hands back your original file unchanged.
- Is it better to compress a PNG or convert it to WebP?
- For flat graphics with transparency, an optimised PNG is universally supported and often close in size to lossless WebP. For photographs, lossy WebP or JPG will be far smaller. If every browser and app that will open the file supports WebP, converting is usually the bigger win; if you need the file to work everywhere, optimise the PNG.