PNG Compressor
Make PNG files much smaller without turning them into JPGs. The compressor reduces each image to an optimized palette of up to 256 colors, keeps every level of transparency and writes a compact indexed PNG. Drop in several files at once, compare before and after, and download them one by one or as a ZIP.
Last updated:
How to use the PNG Compressor
- Add PNG files by dropping them on the box, choosing them, or pasting a screenshot with Ctrl+V. A sample logo is compressed until you add your own.
- Pick the max colors. 256 colors keeps almost every image visually identical; fewer colors give smaller files for icons, logos and diagrams.
- Set dithering. Higher values smooth gradients and photos; turn it off for flat graphics and pixel art to get the smallest files.
- Check the result with Compare: drag the slider over the image and tick Zoom 2× to inspect edges.
- Download each compressed PNG, or click Download all (ZIP) to save the whole batch.
Why PNG files are big and how quantization fixes it
PNG is lossless: it stores every pixel exactly. A true-color PNG with transparency uses 4 bytes per pixel (red, green, blue and alpha), so a 1920 × 1080 screenshot holds about 8.3 MB of raw pixel data before PNG's DEFLATE compression. DEFLATE finds repeated byte patterns, and photos, gradients and shadows have very few exact repeats.
PNG also supports an indexed mode (color type 3). The file stores a palette (the PLTE chunk) of up to 256 colors, an optional alpha value for each palette entry (the tRNS chunk), and then one small index per pixel. This tool converts your image to that format in four steps:
- Histogram. All pixels are counted in a 4-channel RGBA histogram. Fully transparent pixels get their own reserved palette entry.
- Median cut. The color space is split again and again at the weighted median of the channel with the most error, until there are as many boxes as allowed colors. Each box's average becomes a palette color.
- K-means refinement. Every color is reassigned to its nearest palette entry and the entries are re-averaged, which pulls the palette toward the colors that matter most. Distances are measured on alpha-premultiplied values, so nearly transparent pixels do not waste palette slots.
- Dithering and encoding. Floyd-Steinberg error diffusion (7/16, 3/16, 5/16, 1/16 of the error to the neighbours) hides banding, then the indexes are packed at 1, 2, 4 or 8 bits per pixel and zlib-compressed into a valid PNG.
Which color count to choose
| Image type | Max colors | Dithering | Typical saving |
|---|---|---|---|
| Screenshots, UI mockups, web graphics | 256 | 0-50% | 60-80% |
| Logos and icons with transparency | 64-256 | 50-75% | 50-75% |
| Charts, diagrams, line art | 16-32 | Off | 70-90% |
| Pixel art, sprites | As few as it uses | Off | Lossless, smaller file |
| Photos and illustrations with gradients | 256 | 75-100% | 40-70% (JPG or WebP is often smaller) |
Savings depend on the image; the list above shows the exact result for each of your files.
Tips
- Resize first. Halving the width and height cuts the pixel count by 75%, more than any compression setting. Use the Image Resizer, then compress.
- Use the 2× zoom on the comparison view to check thin text and soft shadows before you replace the originals.
- Website images: a compressed PNG keeps crisp edges and transparency, which JPG cannot do. For photos without transparency, PNG to JPG or WebP usually wins.
- Compressed PNGs are standard files: they open in every browser, image editor and operating system.
Frequently asked questions
How does this PNG compressor make files smaller?
A normal PNG stores up to 16.7 million colors, using 3 or 4 bytes per pixel. This tool picks the best palette of at most 256 colors for each image and stores every pixel as a single palette index (or even 1, 2 or 4 bits for very few colors). Indexed pixels repeat far more often, so the DEFLATE compression inside PNG works much better. The result is usually 50-80% smaller.
Is the compression lossless?
Only when the image already uses no more colors than you allow; then it is converted to an indexed PNG with no change at all. Otherwise it is lossy: similar colors are merged. At 256 colors with dithering the difference is very hard to see on screenshots, logos, icons and illustrations.
Does it keep transparency?
Yes. The palette stores an alpha value for each color (the PNG tRNS chunk), so fully transparent areas, soft shadows and anti-aliased edges are preserved. Untick Preserve transparency only if you want the image flattened onto a white background.
What is dithering and when should I turn it off?
Dithering mixes neighbouring palette colors in a fine pattern so gradients do not show visible bands. It helps photos and smooth gradients. For flat graphics, charts, pixel art and UI screenshots, turning it off gives cleaner edges and usually a smaller file.
Why is my compressed file not smaller?
Some PNGs are already indexed or heavily optimized. In that case the original is kept when Keep original if it is already smaller is ticked, so you never get a bigger file. Photos are better saved as JPG or WebP; try the Image Compressor for those.
Are my images uploaded to a server?
No. Decoding, quantization and PNG encoding all happen in your browser in a background worker. The files never leave your device, and the tool keeps working offline once the page has loaded.
Is there a size or file limit?
There is no fixed number of files. Each image can be up to 40 megapixels; very large images take a few seconds and need enough free memory in your browser.
Are all the tools on FreeToolCabin tested for quality and accuracy?
Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.