Home › Image Tools › PNG Compressor

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:

2 · smallest256 · best quality
off · flatsmooth gradients
Advertisement
Advertisement

How to use the PNG Compressor

  1. 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.
  2. Pick the max colors. 256 colors keeps almost every image visually identical; fewer colors give smaller files for icons, logos and diagrams.
  3. Set dithering. Higher values smooth gradients and photos; turn it off for flat graphics and pixel art to get the smallest files.
  4. Check the result with Compare: drag the slider over the image and tick Zoom 2× to inspect edges.
  5. 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:

  1. Histogram. All pixels are counted in a 4-channel RGBA histogram. Fully transparent pixels get their own reserved palette entry.
  2. 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.
  3. 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.
  4. 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 typeMax colorsDitheringTypical saving
Screenshots, UI mockups, web graphics2560-50%60-80%
Logos and icons with transparency64-25650-75%50-75%
Charts, diagrams, line art16-32Off70-90%
Pixel art, spritesAs few as it usesOffLossless, smaller file
Photos and illustrations with gradients25675-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.

Related tools

Image CompressorShrink images to a target size like 100 KB.PNG to JPGBatch convert PNG images to JPG with a background color.PNG & JPG to WEBPConvert PNG and JPG images to smaller WEBP files.Image ResizerResize images to any size without losing quality.Compress Image to 20KBShrink any photo to under 20KB (or any target size).Compress Image to 100KBShrink any photo to under 100KB automatically, with the best quality that fits.Compress JPEG to 50KBShrink photos to under 50KB for forms, passports and exams.Image CropperCrop images, including circle crops for profile pictures.Rotate & Flip ImageRotate images by any angle or mirror them, one or many at once.Collage MakerCombine photos into a grid collage.Aspect Ratio CalculatorCalculate image sizes for 16:9, 4:3 and any ratio.Image Border AdderAdd a border, rounded corners, matte and shadow to a photo onlineImage SplitterSplit an image into a rows × columns grid of tiles and download them one by one or as a ZIP.Image CombinerCombine images side by side, stacked or in a grid, with spacing, background color and alignment.Image UpscalerEnlarge images 2×, 3× or 4× with Lanczos-3 or bicubic resampling and optional sharpening.Image DPI ChangerChange the DPI of JPG and PNG images without re-encoding, and see the print size.Pixel Art MakerDraw pixel art on an 8 to 64 px grid with palettes, fill and mirror, then export PNG or SVG.Social Media Image ResizerResize photos for Instagram, Facebook, X, LinkedIn, YouTube, TikTok and Pinterest in one go.Image Diff CheckerCompare two images and highlight every changed pixel, with % difference and a swipe slider.Emoji to ImageTurn any emoji into a PNG image from 64 to 1024 px, transparent or on a color, in batch.Text to ImageTurn text into a PNG image with your font, size, colors, padding, alignment and wrapping.SVG OptimizerMinify SVG files: strip metadata, comments and editor junk, round numbers, compare sizes.Compress Image to 200KBShrink any photo to under 200KB automatically, with the best quality that fits.Crop GIFCrop an animated GIF with a draggable box or aspect ratio presets, keeping every frame.Crop Image into ShapeCrop a photo into a heart, star, hexagon, circle, speech bubble or custom SVG shape as a PNG.Drawing Grid MakerPut a numbered grid on a reference photo to copy it by hand. Print it or save as PNG or PDF.Resize GIFResize an animated GIF by width, height or percent, skip frames and compare file sizes.Square Image Maker (No Crop)Make any photo square, 4:5 or 9:16 without cropping, with a color, blur or gradient fill.Text Behind ImagePut text behind the subject of a photo: AI cut-out, fonts, colors, rotation and PNG export.Bulk Image ResizerResize many images at once by width, height, percent or longest side and download a ZIP.JPG to WordTurn photos and scans into an editable Word document with OCR. Batch images, 30+ languages.Photo Measurement ToolMeasure distances, areas and angles on a photo using a card or ruler in the picture for scale.Pupillary Distance MeasurementMeasure your PD in mm from a webcam or photo with a card for scale, single and dual PD.Brighten ImageBrighten dark photos with auto exposure, shadows lift and highlight protection. Batch, no upload.Change Image Aspect RatioConvert photos to 1:1, 4:5, 16:9, 9:16, 3:2 or any ratio by crop, color padding or blur fill.Crop Photo for PrintCrop photos to 4x6, 5x7, 8x10, 11x14 or A4 print ratios with a DPI quality check, then export.Long Screenshot StitcherStitch scrolling screenshots into one long image with automatic overlap detection.Image to Minecraft Pixel ArtConvert any image into Minecraft block pixel art with block counts, stacks and a row-by-row build guide.Fix Image OrientationRotate sideways photos upright for good by applying the EXIF orientation to the pixels, in batch.Image Format DetectorFind an image's real format from its magic bytes, see size and bit depth, and fix a wrong extension.Increase Image Size in KBMake a photo's file size bigger (e.g. 50 KB or more) to pass minimum upload limits, with no visible change.Megapixel CalculatorTurn width × height into megapixels, aspect ratio and max print size, or MP back to pixels.Volleyball Rotation ToolEnter 6 players and a 5-1, 6-2 or 4-2 system to see all rotations and serve receive on a court.Auto Face CropDetect faces and crop centered headshots at any ratio and padding, in batch.Content-Aware Image ResizeResize images with seam carving to keep people and objects intact; protect or remove areas.Scanned Photo SplitterSplit several photos from one flatbed scan: auto-detect, straighten and crop each, then ZIP.Pixel Art UpscalerUpscale pixel art and sprites crisply with nearest neighbor, Scale2x/3x or xBR, keeping transparency.Resize Image in CM and InchesResize a photo to an exact print size in cm, mm or inches at any DPI. JPG, PNG or PDF.Online Screenshot ToolCapture your screen, a window or a tab, then crop, annotate and copy or save it as PNG.Trim Image WhitespaceAuto-crop white borders or transparent padding from images with tolerance and margin. Batch.
See all 49 Resize, Crop & Compress →