iFixImg
GuideJul 25, 2026 · 6 min read

How to Compress PNG Without Losing Quality

PNG is a lossless format, which means it stores every pixel exactly as it is. That is great for quality but terrible for file size — a full-screen PNG screenshot can easily be 3–5MB. The good news is you can often cut that by 60–80% without any visible change to the image.

Why PNG files are so large

PNG uses lossless compression (DEFLATE), which means no data is thrown away. Every pixel value is stored exactly. This makes PNG ideal for screenshots, logos, and graphics with flat colours — but it is overkill for photographs, where the visual difference between a JPEG at 80% quality and a lossless PNG is invisible to the human eye.

There are two main ways to compress a PNG:

  1. Lossless optimisation — strips metadata (EXIF, ICC profiles, comments), optimises the compression algorithm. Saves 10–30%. Genuinely zero quality loss.
  2. Lossy compression — reduces the colour palette (quantisation). Saves 40–80%. Looks identical to the human eye in most cases.

Option 1: Use iFixImg (Free, browser-based)

The fastest option. Drop your PNG into the compressor — it runs entirely in your browser and uses libvips under the hood, the same library that powers Cloudinary and Imgix. No upload, no account.

Compress your PNG right now — no upload, no accountCompress PNG →

Option 2: Squoosh (Google's free tool)

Squoosh is a browser tool built by the Google Chrome team. It gives you fine-grained control with a before/after preview. For PNG specifically, choose OxiPNG for lossless (strips metadata, optimises zlib settings) or WebP lossless if you want to stay lossless but in a more efficient format.

If your goal is maximum compression and you don't need PNG specifically, switch to WebP at quality 80–85. You'll typically get 60–70% smaller files with no perceptible loss, and WebP is supported in every modern browser and app.

Option 3: pngquant (CLI, lossy, best results)

pngquant is the gold standard for lossy PNG compression. It quantises the colour palette from 24-bit (16 million colours) to 8-bit (256 colours). For most images this is invisible. Typical savings: 60–80%.

# Install
brew install pngquant          # macOS
sudo apt install pngquant      # Ubuntu/Debian

# Compress a single file (saves as image-fs8.png)
pngquant --quality=65-80 image.png

# Compress in place (overwrites original)
pngquant --quality=65-80 --ext .png --force image.png

# Batch compress all PNGs in a folder
pngquant --quality=65-80 --ext .png --force *.png

Option 4: ImageMagick (lossless strip)

If you just want to strip metadata and optimise compression without touching pixels, ImageMagick can do it in one command:

# Strip EXIF, ICC profiles, comments — lossless
magick input.png -strip -define png:compression-level=9 output.png

# Batch process a directory
for f in *.png; do
  magick "$f" -strip -define png:compression-level=9 "compressed/$f"
done

Should you just convert to WebP instead?

Honestly — for most use cases, yes. WebP lossless is typically 26% smaller than PNG lossless, and WebP lossy at quality 80 is 25–34% smaller than JPEG at equivalent quality. If your image is going on a website and doesn't need to be a PNG specifically, converting to WebP is usually the better call.

Convert PNG to WebP in your browserConvert to WebP →

When to stay with PNG

PNG is still the right choice when you need:

  • Transparency (alpha channel) — JPEG doesn't support it; WebP does but some legacy systems don't
  • Screenshots and UI mockups — flat colours compress exceptionally well in PNG
  • Logos and icons with hard edges — JPEG introduces ringing artefacts around sharp lines
  • Source files you'll edit again — never save a JPEG on top of a JPEG

References: Google — WebP lossless spec · pngquant.org · web.dev — Imagemin guide