Compress & optimise

Compress PNG files

PNG has no quality slider, so this tool reduces the colour palette instead, which is what actually makes PNG files smaller.

  • Runs in your browser
  • Nothing is uploaded
  • No sign-up
  • Batch up to 20 images

Drag & drop your image here

or tap to browse · you can also paste from the clipboard

JPG · PNG · WebP · GIF · BMP · AVIF · SVG  ·  up to 50 MB each · up to 20 files

Choose images

How to use the png compressor

PNG has no quality setting in any browser, so this tool reduces the colour palette instead. That is what actually makes a PNG smaller. A screenshot with 40,000 colours reduced to 128 typically drops 60-75% in size. Palette reduction is lossy; transparency is preserved.

  1. Add PNG filesTransparency is kept at every step.
  2. Choose a palette sizeAuto inspects the image, or pick 256 / 128 / 64 / 32 / 16 colours yourself.
  3. Compare and downloadCheck the preview for banding, then save.

About this tool

PNG uses lossless DEFLATE compression, and no browser exposes a quality knob for it. What matters is the number of distinct colours: fewer colours means longer repeating runs, and DEFLATE compresses those runs far better. Reducing a screenshot from 40,000 colours to 128 often cuts the file by 60-75%.

That palette reduction is lossy, because colours are approximated. Floyd-Steinberg dithering scatters the error across neighbouring pixels so gradients still look smooth instead of banded. Transparency is preserved throughout.

If your PNG is actually a photograph, no PNG optimiser will beat simply converting it to WebP or JPG.

What you get

  • Median-cut colour quantisation with optional dithering
  • Full alpha transparency preserved
  • Auto palette selection based on image statistics
  • Optional resize for further savings
  • Clear warning when the output is not smaller than the input

When to use the png compressor

Screenshots in documentation

UI screenshots contain large flat areas and a limited palette. 128 colours usually cuts the file by two-thirds with no visible change to text or chrome.

Logos and icons with transparency

Flat brand graphics often survive 32-64 colours untouched, while keeping the alpha channel that JPG cannot store.

Illustrations and flat-colour artwork

Vector-style artwork exported as PNG is an ideal candidate, with few distinct colours and large uniform regions.

Deciding whether PNG is right at all

If the image is a photograph, no PNG optimiser will beat simply converting it to WebP or JPG. Compare here and decide with real numbers.

How it works

PNG uses DEFLATE, a lossless algorithm that finds repeated byte sequences. Its effectiveness depends almost entirely on how predictable the pixel data is. Fewer distinct colours means longer runs of identical bytes and better back-references, which is why the palette size, rather than a quality setting, decides how small a PNG gets.

The quantiser here is median cut. It builds a histogram of the image in 15-bit colour space, then repeatedly splits the colour box with the largest spread along its longest axis at the weighted median, until it has the requested number of boxes. Each box's weighted centroid becomes a palette entry. Mapping pixels to that palette uses a 32,768-entry lookup cache so each distinct colour is matched only once, rather than searching the palette for every pixel.

Floyd-Steinberg dithering distributes each pixel's quantisation error to its right and lower neighbours. This trades a little added noise for the removal of visible banding, which is a clear win on gradients and a clear loss on flat colour. Dithered noise in a flat region makes the file larger, because it breaks up the runs DEFLATE relies on.

Common problems and how to fix them

The compressed PNG is bigger than the original
Your source was already optimised by a dedicated tool such as pngquant or OptiPNG, which squeeze the DEFLATE stream harder than a browser can. The tool tells you when this happens. Keep the original.
I can see banding in the gradient
Turn dithering on, or raise the palette to 256. Smooth gradients are the hardest case for a limited palette.
The image looks speckled or noisy now
That is dithering on flat colour. Turn it off for logos, icons and pixel art.
Auto did not reduce the size much
Auto encodes both a lossless and a quantised version and keeps whichever is smaller, so it never returns a larger file. If the saving is small, choose a specific palette size manually and compare.
My photo saved as PNG is still huge
PNG is the wrong container for photographs. Convert to WebP or JPG and expect an 80-90% reduction, against the 20-40% that palette reduction can offer.

Frequently asked questions

Is PNG compression lossless here?

Only the "Lossless only" option is: it just re-encodes. Every palette setting is lossy because colours are mapped to a reduced set, and the settings are labelled that way.

My compressed PNG is bigger than the original. Why?

Your source was already optimised by a tool like pngquant or OptiPNG, which squeeze the DEFLATE stream harder than a browser can. Keep the original. The tool tells you when this happens.

How many colours should I choose?

Logos, icons and flat illustrations usually survive 32-64 colours untouched. Screenshots with text look good at 128. Photographs need 256 and still often band, so convert those to WebP instead.

Should I turn dithering on?

Yes for gradients, skies and soft shadows, where it hides banding. Turn it off for flat-colour logos and pixel art, where dithering adds visible speckle and can actually enlarge the file.

Will transparency be kept?

Yes. The alpha channel is preserved exactly; only the RGB values are quantised, and fully transparent pixels are left untouched.

Is there such a thing as lossless PNG compression?

Yes. That is what PNG's DEFLATE stage already is, and the "Lossless only" option here simply re-runs it. But a browser's encoder cannot match dedicated tools like OptiPNG or ZopfliPNG, which try many filter and compression strategies. Real savings on PNG come from reducing colours, which is lossy.

PNG-8 vs PNG-24, which is this producing?

The output is a standard PNG with quantised colours. Browsers cannot write a true indexed PNG-8 palette chunk, so the file is structurally PNG-24 with far fewer distinct colours. DEFLATE captures most of the benefit either way.

When should I use PNG at all?

When you need transparency, sharp edges, text or exact pixel fidelity: screenshots, logos, icons, diagrams and pixel art. For photographs, WebP or JPG is smaller and looks the same.

You may also like

Browse all 89 image tools

Ready when you are

Free, private, and done on your own device.

Add your image