How to Compress PNG Without Losing Quality

You export a PNG from Figma, Photoshop, or a screenshot tool and it's 4 MB. You need it under 500 KB for a web page, an email, or a client deliverable. Your first instinct is to re-export at lower quality — but PNG doesn't have a quality slider like JPEG. So you're stuck choosing between a bloated file and a visibly degraded image.

The good news: PNG compression works differently from JPEG. There are ways to remove significant file weight without touching a single visible pixel. You just need to know which levers to pull.

Quick Answer

Yes, you can compress a PNG without losing visible quality. PNG is a lossless format, so tools like PNGQuant, OptiPNG, and Squoosh reduce file size by stripping unnecessary metadata, reducing the color palette, and re-encoding pixel data more efficiently. Most PNGs can be reduced by 40–70% with zero perceptible change to the image.

What is PNG compression?

PNG (Portable Network Graphics) is inherently a lossless format — meaning the file always decodes to an exact copy of the original pixel data. But that doesn't mean every PNG file is as small as it could be. There are two distinct ways PNG files can be made smaller without degrading what you see:

The key distinction: neither of these is the same as JPEG-style lossy compression, which permanently discards pixel information and introduces visible artifacts. Done correctly, PNG compression is genuinely non-destructive.

Why it matters for your site and workflow

Unoptimized PNGs are one of the most common causes of slow-loading web pages. A single screenshot embedded in a blog post or landing page can weigh more than the rest of the page combined. The downstream effects compound quickly:

📊 Quick stat HTTP Archive data shows that images account for roughly 45–50% of the total byte weight of the average web page. Optimizing PNGs is the highest-leverage single action most teams can take to reduce page weight.

Step-by-step: how to compress a PNG without losing quality

  1. Identify what kind of PNG you're working with. Open the image and ask: is this a photograph? A screenshot? A flat-color logo or illustration? Photographs rarely compress well as PNG — consider converting to WebP or JPEG instead. Screenshots, UI assets, and flat graphics are where PNG compression delivers huge wins.
  2. Strip metadata first. Before anything else, remove embedded EXIF data, ICC color profiles, and text chunks that tools like Photoshop or macOS Finder add automatically. Tools like ExifTool or the Rebrixe PNG Compressor do this automatically. This alone can reduce size by 5–15%.
  3. Run palette quantization if the image allows it. Use PNGQuant (command line: pngquant --quality=85-95 input.png) or a GUI equivalent. Set the quality range to 85–95 to keep the result visually lossless while achieving large size reductions. The output will be a new file (e.g., input-fs8.png).
  4. Follow up with lossless re-encoding. Run OptiPNG or OxiPNG on the quantized output. This second pass applies a more aggressive DEFLATE compression level without touching pixel data: optipng -o5 input-fs8.png. The two-pass approach (quantize → re-encode) consistently outperforms either tool used alone.
  5. Compare the output side by side. Open the original and compressed versions at 100% zoom in your image viewer. Look for banding in gradients, color shifts in flat fills, or noise in smooth areas. If you see any of these, your quantization step was too aggressive — dial the quality range up to 90–99 and repeat.
  6. Check the actual file size reduction. If you're only seeing 10–20% savings, the image likely has complex color distribution (close to a photograph). At that point, evaluate whether PNG is the right format — the same image as WebP will almost certainly be smaller with equivalent or better quality.
  7. Automate for production workflows. If you're compressing images regularly, set up a build step. Most static site generators (Astro, Next.js, Eleventy) have image optimization plugins that run PNGQuant or Sharp automatically. For manual workflows, ImageOptim on macOS runs all passes with one drag-and-drop.
Try the Rebrixe PNG Compressor — free No uploads, no signup. Runs entirely in your browser.
Compress PNG Now →

Common mistakes that tank quality

1. Confusing PNG compression with JPEG compression

PNG compression has no "quality" setting in the JPEG sense — there's no slider from 1–100 that degrades the image progressively. If you're exporting a PNG from Photoshop at "quality 60," what you're really doing is reducing DEFLATE compression effort, not pixel quality. The result is a barely smaller file with no quality benefit. Use dedicated PNG optimization tools instead of export settings.

2. Running quantization on photographs

Palette reduction works beautifully on flat-color graphics and screenshots. It works terribly on photographs, which genuinely use millions of distinct color values. Forcing a photo down to 256 colors produces visible banding and color blocking. If you're working with a photograph, convert to WebP or JPEG — don't try to compress it as PNG.

3. Overwriting the original

Always keep the original PNG. Near-lossless compression makes imperceptible changes — but if you need to re-process or edit the image later, working from a compressed source compounds artifacts. Keep originals in a separate folder and only serve the compressed versions.

4. Ignoring transparency

If your PNG has a transparent background, converting to JPEG destroys it. Run your compression with a tool that preserves alpha channels — PNGQuant handles transparency correctly; some older online tools don't. Always check the output on a non-white background to confirm the alpha layer is intact.

💡 Pro tip After compressing, open the output file in a browser tab and zoom to 200–400%. If you see stairstepping on smooth gradients or unexpected color bands, your quantization settings were too aggressive. Increase the minimum quality value by 5–10 points and re-run.

Real-world compression examples

These are representative results from running PNGQuant (quality 85–95) followed by OptiPNG (-o5) on common PNG types:

UI Screenshot
Dashboard screenshot
−67%
3.2 MB → 1.05 MB. Zero visible difference at 1× zoom.
Flat Illustration
Icon / logo export
−78%
840 KB → 185 KB. Palette reduction ideal for limited color count.
Gradient graphic
Hero banner with gradient
−41%
2.1 MB → 1.24 MB. Slight banding risk — quality set to 92+.
Photograph as PNG
Product photo (PNG)
−18%
4.8 MB → 3.94 MB. Convert to WebP for a real win here.

The pattern is consistent: flat graphics and screenshots compress dramatically. Photographic content in PNG format resists compression and should be converted to a better format entirely.

Tool comparison

The right tool depends on your workflow — browser-based for occasional use, command-line or build-tool integration for production pipelines.

Tool Type Lossless Palette reduction Privacy Best for
Rebrixe PNG Compressor Browser Yes Yes Client-side only Quick one-off compression, no uploads
Squoosh Browser Yes Yes Client-side only Visual before/after comparison
TinyPNG Browser / API Lossy only Yes Server upload Batch compression via API
PNGQuant CLI Near-lossless Yes Local Scripting and build pipelines
OptiPNG / OxiPNG CLI Yes No Local Maximum lossless compression pass
ImageOptim (macOS) Desktop app Yes Yes Local macOS drag-and-drop batch workflows

Compress your PNG right now — free

The Rebrixe PNG Compressor runs entirely in your browser. Your images are never uploaded to a server — compression happens locally using WebAssembly-powered PNGQuant and OptiPNG under the hood. No account, no file size limit, no watermarks.

Free PNG Compressor — no uploads required Client-side only. Your files never leave your device.
Open PNG Compressor →

Frequently asked questions

Yes. PNG is a lossless format, which means tools can remove redundant metadata, re-encode pixel data more efficiently, and reduce the color palette without changing anything visible. The output is perceptually identical to the original — often pixel-identical in the lossless case — at a fraction of the file size.
Typically 40–80% for screenshots and flat-color graphics. The more limited the actual color range in the image, the more aggressive the palette reduction can be without any visible effect. Photographs as PNGs compress poorly — expect 10–25% at best, and you should consider converting to WebP or JPEG instead.
Lossless compression (OptiPNG, OxiPNG) re-encodes the file more efficiently — the decompressed image is pixel-for-pixel identical to the original. Lossy-ish palette reduction (PNGQuant, TinyPNG) reduces the number of unique colors used, producing pixel values that differ slightly from the original. The difference is usually invisible, but the file is technically not pixel-identical. Both are still far less destructive than JPEG compression.
With pure lossless compression (OptiPNG), no — re-running it produces no quality change, just diminishing file size returns once the file is already well-compressed. With palette reduction (PNGQuant), running it a second time on an already-quantized file can introduce additional color shifts, so avoid repeating that step. Always keep your original and only compress a copy.
For browser-based use with no uploads, the Rebrixe PNG Compressor and Squoosh are the best options. For command-line workflows and automation, PNGQuant followed by OxiPNG is the gold standard combination. For macOS desktop use with drag-and-drop simplicity, ImageOptim handles multiple passes automatically.
WebP consistently produces smaller files than PNG for most content types, including images with transparency. Browser support is now universal for modern browsers. If you're targeting modern web, WebP is the better choice. PNG remains the safer option for maximum compatibility (some older tools and CMS platforms still don't handle WebP correctly) and for workflows where pixel-perfect accuracy matters.
JPEG for product photographs without transparent backgrounds — it produces dramatically smaller files because photographs contain complex color gradients that PNG encodes very inefficiently. Use PNG for product images that require a transparent background (packshots, cut-out items), and consider WebP as a modern alternative that handles both cases well.

Compress your PNG in seconds

The Rebrixe PNG Compressor runs entirely in your browser — no uploads, no account, no file size limits. Your images never leave your device.

Launch the PNG Compressor →
← Back to blogs