Compress PNG
Shrink screenshots, logos and illustrations saved as PNG, with transparency kept. Choose how many colours to keep and compare before and after, on your device.
Drop PNG images here
Or any picture: it is saved as PNG. As many as you like.
Your images are compressed on this device and never uploaded. Metadata (EXIF, GPS) is removed.
How this works: Method, 6 sources, Checked against 2 worked examples,
How this works
Method
Each image is decoded by the browser, turned upright, resized if asked and drawn on a canvas in a background worker. JPEGs are encoded with MozJPEG at your quality; PNGs are cut to the colours you choose by median cut with softened Floyd–Steinberg dithering, then packed by OxiPNG; WebPs use the browser’s encoder. For a target size, real encodings are bisected for the best setting that fits, shrinking the picture if even the lowest is too big. Files are rebuilt from pixels, so no EXIF is kept.
Sources
- W3C: Portable Network Graphics (PNG) Specification (Third Edition, 2025)
- Heckbert, Color image quantization for frame buffer display (SIGGRAPH) (1982)
- ITU-T T.81 | ISO/IEC 10918-1: JPEG (digital compression of continuous-tone still images) (1992)
- RFC 9649: WebP Image Format (2024)
- MozJPEG (Mozilla JPEG encoder)
- OxiPNG, a lossless PNG optimiser
How it’s tested
2 worked examples for this page are checked by automated tests before every release: given the inputs, the tool must show the expected answer.
Changes
- First version: JPG, PNG and WebP compression by quality or target size, a before and after view, resize, ZIP download, and Compress JPEG and Compress PNG pages.
How a PNG gets smaller without becoming a JPEG
PNG is lossless, so the only way to make the same picture much smaller is to give it less to store. The compressor finds the colours that matter most (a median cut, splitting the picture’s colours into groups until it has the number you chose) and maps every pixel to the nearest one. A picture with at most 256 colours can be stored as an indexed PNG: one byte per pixel, or less, instead of four.
Gradients would show bands with so few colours, so the leftover error of each pixel is spread to its neighbours (Floyd–Steinberg dithering, softened here so flat areas stay clean). Transparency is part of every colour, so cut-outs and soft shadows keep their see-through edges.
OxiPNG then packs the file: it tries different row filters and compression settings and keeps the smallest, without changing a pixel. Lossless mode does only this step, for pictures where every pixel must stay exact.
Photos don’t suit this well: their millions of subtly different colours need either many colours or dithering noise. For photos, Compress JPEG gives far smaller files.
Good to know
- A PNG can store an indexed-colour image: a palette of up to 256 entries and one index per pixel, with transparency per palette entry. Source: W3C: Portable Network Graphics (PNG) Specification
- Median cut, the colour reduction used here, splits the image’s colour space into boxes holding equal numbers of pixels and uses one colour per box. Source: Heckbert, Color image quantization for frame buffer display (SIGGRAPH)
Open-source code inside, loaded only when needed: JPEGs are encoded with MozJPEG, PNGs packed with OxiPNG and WebP written with libwebp where the browser can’t. Pictures, HEIC included, are decoded by the browser itself. Licences and source
How to compress PNG images3 steps, all on your device
- Drop the PNGs. Add screenshots, icons, diagrams or cut-outs. Other images are saved as PNG too.
- Choose the colours. 256 colours looks the same as the original for most graphics; fewer makes smaller files. Lossless keeps every pixel and only repacks the file.
- Compare and download. Check the before and after, then save each PNG or a ZIP of all of them.
Frequently Asked Questions
Does compressing a PNG keep transparency?
Yes. Transparency is part of each palette colour, so transparent backgrounds, soft edges and shadows are kept. Fully transparent pixels stay fully transparent.
How many colours should I keep?
256 is safe for most screenshots, logos and illustrations. Try 64 or 32 for simple graphics with flat colours. Choose Lossless when every pixel must stay exactly as it was, for example for pixel art or images you will edit further.
Is this like TinyPNG?
It uses the same idea, reducing a PNG to a smaller palette, but runs entirely in your browser: the images are never uploaded, and there is no limit on how many you compress.