iLoveConverter
Categories 11 categories

Compress PNG: Lossless PNG Optimization Without Quality Loss

iLoveConverter Team 3 min read

On this page

PNG is a lossless image format — every pixel is preserved exactly. But “lossless” doesn’t mean “uncompressed.” PNG uses DEFLATE compression (the same algorithm as ZIP) to shrink image data. Most PNGs you find online are NOT fully optimized — the image editors that created them (Photoshop, GIMP, browsers) use safe but suboptimal DEFLATE settings. Compress PNG re-compresses PNG files with better DEFLATE configurations and applies additional lossless optimizations to reduce file size while keeping every pixel identical.

What PNG compression actually does

PNG files have two layers of compression potential:

1. Filter types

PNG applies one of five filter types to each row of pixels before DEFLATE compression. The filter type that works best depends on the image content — none (0), sub (1), up (2), average (3), Paeth (4). Most editors pick one filter type for the entire image. Optimizers try all five for every row and pick the combination that compresses best.

2. DEFLATE compression level

DEFLATE has levels from 0 (no compression) to 9 (maximum compression). Most image editors use level 6 — a reasonable speed/size trade-off. Optimizers use level 9 (or even level 10+ via 7-Zip’s DEFLATE implementation) which takes longer but produces smaller files.

How much smaller can you expect?

Source PNG TypeTypical SavingsNotes
Screenshots with flat UI40-70%Great candidate — flat colors compress very well
Icons, logos with few colors30-60%Even better with palette reduction
Photos/digital paintings5-20%PNG isn’t ideal for photos — consider PNG to WebP or PNG to JPG
Heavily optimized already0-15%Not worth it

Additional lossless tricks

Some optimizers also:

  • Reduce palette depth. If your 32-bit RGBA PNG actually uses ≤256 colors, it can become 8-bit indexed color with a palette. Reduces file size by ~50% while keeping identical visual output.
  • Remove ancillary chunks. PNG can store metadata (EXIF, comments, ICC profiles, tEXt chunks) that most viewers ignore. Stripping these saves space.
  • Use better DEFLATE. zlib (standard) vs. 7-Zip’s deflate (often 5-10% smaller).

When this is genuinely useful

  1. Preparing PNGs for web delivery. Every kilobyte saved means faster page loads, less bandwidth, lower CDN costs. Optimizing existing PNGs is the lowest-effort high-impact image optimization you can do.
  2. Reducing app bundle size. Mobile apps and desktop applications ship PNG icons and assets. Every KB counts when your app is competing for download attention.
  3. Archiving PNGs. If you’re archiving a large PNG collection (screenshots, game assets), lossless optimization keeps the exact same data in less disk space.

When to switch to lossy alternatives

If your PNG is a photo or digital painting with lots of gradients:

  • PNG to WebP — WebP lossless is typically 25-30% smaller than PNG lossless. WebP lossy (quality 80) can be 5-10% of PNG size with visually indistinguishable output.
  • PNG to JPG — JPG at quality 80 is generally 10-20% of PNG size. Not lossless, but invisible quality difference for most photos.

For flat-color images (UI, icons, logos), stay with PNG — there’s no lossy format that beats PNG on both size and quality for this content type.

FAQ

Will the pixels be exactly identical after compression?

Yes. This is true lossless compression. Every pixel, every alpha value, every color remains exactly the same. If you compare the compressed and original PNG pixel by pixel, they’ll be identical.

Why not just use optipng or pngcrush myself?

These are excellent command-line tools that do exactly what the web compressor does. The web version is convenient if you don’t want to install software, need a browser-accessible solution, or are on a locked-down machine.

What’s the difference between “compressing” a PNG and “converting” it?

Compressing a PNG keeps it as a PNG — same format, smaller file. Converting changes the format (e.g., PNG → WebP). Compression is lossless; conversion might be lossy or lossless depending on the target format.

Try it yourself — free, right in your browser

Everything mentioned in this guide runs locally on this site: no upload, no watermark, no sign-up.

Format deep-dives: PNG (.png)