Rasp

Compress a PNG

A smaller PNG with identical pixels. Optimised on your own machine with oxipng — nothing is uploaded.

Ready
Uploaded0 B

What next

How do I compress a PNG without losing quality?

To compress a PNG without losing quality, drop it onto this page and download the result. It is optimised with oxipng, which rewrites the file's compression losslessly — the pixels are bit-for-bit identical and only the file is smaller. Everything runs in your browser, so nothing is uploaded and there is no limit.

How to do it

  1. Add your PNG. Drag it onto the panel or click to choose. Add as many files as you like.
  2. Let oxipng run. The file is re-compressed losslessly. No settings to choose — there is no quality trade-off to make.
  3. Check the saving. The Smaller by readout shows how much came off. How much varies enormously with content; screenshots and flat graphics do best.
  4. Download the result. The image is pixel-for-pixel identical to what you put in. Nothing has been discarded.

At a glance

ConvertsPNG to PNG
TransparencyPreserved
CompressionLossless, then optimised with oxipng — identical pixels
Where it runsIn this browser tab. The file is not uploaded
File size limitNone imposed — your device memory is the ceiling
CostFree
Account neededNo
WatermarkNone
Works offlineUsually after first use, but not guaranteed — there is no offline app

What it actually produces

Measured, not estimated. A procedurally generated 2400×1600 (3.8 MP) test image built to carry photographic entropy: value noise across nine octaves down to near-pixel scale, a dense field of small high-contrast features, a smooth gradient, hard edges and light grain. It is not a photograph — it is reproducible, which a photograph is not. Each figure below comes from running that image through this page.

InputOutputChange
3.97 MB3.38 MB15% smaller

Your own files will differ — a photograph, a screenshot and a diagram compress very differently. The point of a fixed image is that the formats can be compared with each other, not that your result will match.

What does lossless PNG compression actually do?

Nothing to your image. That is the whole point.

A PNG stores its pixels using a filter step followed by DEFLATE compression, and there are many valid combinations of those choices that produce the same picture at different file sizes. Most encoders pick reasonable defaults and move on.

oxipng tries harder. It searches through filter strategies and compression parameters looking for the smallest encoding of exactly the same data. Decode the file it gives you and decode the file you gave it, and you get identical images — every pixel, including the alpha channel.

There are no settings on this page because there is no trade-off to make. Either a better arrangement exists or it does not.

How much will it save?

It depends heavily on what the image contains.

On the photographic test image used for every measurement on this site, the saving was around 15%. Photographs are the hard case: they are full of fine, near-random detail, which is exactly what lossless compression struggles with.

Screenshots, logos, diagrams and UI mockups generally do much better. Those images have large areas of flat colour and repeating structure, which is where an encoder’s choices matter most and where a naive one leaves the most on the table.

If your file barely shrinks, that usually means it was already well optimised — which is good news, not a failure.

When lossless is the right choice

Use it when every pixel has to stay exact:

  • Screenshots containing text, where lossy compression visibly softens letters
  • Diagrams and charts with fine hairlines
  • Images you will edit further, where you do not want artefacts baked in
  • Logos and icons with hard edges against transparency

When to reach for a lossy format instead

If you only need the file to be smaller and it is going on a web page, lossless optimisation is leaving most of the saving unclaimed.

On the same test image: lossless optimisation gave 15%. Converting to WebP gave 94%. Converting to AVIF gave 97%.

Those formats also keep transparency, so for web use they are usually the better answer — with this page reserved for the cases where exactness genuinely matters.

Questions

Is this really lossless?
Yes, in the strict sense. oxipng does not alter a single pixel value. It re-examines how the image data is filtered and compressed and finds a more efficient encoding of exactly the same information. Decode the input and the output and you get identical images.
How much smaller will my PNG get?
It varies enormously with content. On the photographic test image used for measurements here, the saving was about 15%. Screenshots, logos, diagrams and anything with large areas of flat colour often do considerably better, because those are the images where a naive encoder leaves the most on the table.
Why did my PNG barely shrink at all?
Because it was already well optimised. Files exported by design tools and by other optimisers often have little slack left. A small saving is a sign the original was good, not that the tool failed.
Should I use this or convert to WebP?
Use this when every pixel must stay exact — screenshots of code, diagrams with fine lines, images you will edit further. Convert to WebP when you want a big saving and can accept a lossy result: on the same test image, WebP was 94% smaller where lossless optimisation managed 15%.
Does it keep transparency?
Yes, exactly. The alpha channel is part of the image data, and lossless means lossless.
Is my image uploaded?
No. The optimisation runs in this browser tab in a Web Worker. The Uploaded readout beside the result measures the page's own outbound traffic, so a successful run reads 0 B.
Are there settings to adjust?
No, deliberately. There is no quality trade-off to make in lossless compression — there is only whether the encoder found a better arrangement of the same data. Exposing a slider would imply a decision that does not exist.
Is there a file size limit?
None imposed. Optimisation is computationally heavy, so very large files take time, but nothing is rejected for size.
Can I compress several PNGs at once?
Yes. Add as many as you like — there is no upload, so no queue. Bear in mind each one is processed in turn and the work is genuinely intensive.
Will it remove metadata?
Ancillary chunks that do not affect the image may be dropped as part of the optimisation. The pixels are untouched.

About these formats

Sources

Related tools