Melt guide

Compress a PNG without losing image quality (Mac)

Yes, you can shrink a PNG dramatically and have it look identical. Here's how on macOS.

4 min read

You need that PNG smaller, but it’s a design asset — a clean UI mockup or a logo — and any visible artefacting is unacceptable. The trick is that “lossless” and “looks identical” aren’t the same thing. You can drop a PNG to a third of its size and not see the difference with your eyes pressed against the screen.

Why this happens

Most PNGs are stored in 24-bit truecolour with an 8-bit alpha channel — 32 bits per pixel. A UI screenshot or vector export usually contains fewer than 256 distinct colours. Re-mapping to an indexed palette (a process called quantization) is technically lossy, but the loss is mathematical, not visual. Your monitor can’t render the difference and your eyes can’t see it.

The native way (truly lossless)

sips will re-encode a PNG with maximum zlib compression. From Terminal:

sips -s format png —setProperty formatOptions 100 input.png —out output.png

This is genuinely byte-perfect lossless. Expect 5-15% savings — every pixel survives exactly as it was, and the file shrinks only by tightening the compression stream.

For more, install optipng or zopfli:

brew install optipng && optipng -o7 input.png

optipng -o7 tries every filter and compression strategy. Still byte-perfect lossless, and usually nets 10-25% on top of what Preview produces.

The faster way (visually lossless)

If you want real reductions — 60-85% — you want pngquant-style quantization, which is “visually lossless” rather than “byte-for-byte lossless.” Download Melt runs this in a drag-and-drop pass:

  1. Download Melt and open it.
  2. Drag the PNG in.
  3. Pick a quality — 90 is the highest visually-lossless tier, 80 is the sweet spot for almost everything.
  4. Click Compress.

At 90, even side-by-side comparisons rarely reveal the difference. At 80, you’d need a colour picker to find the variance.

How much smaller will it really get?

For a UI mockup or screenshot at quality 90: 50-70% smaller. At quality 80: 75-85%. For photographs saved as PNG: convert to JPEG instead — that’s the right tool for photographic content. PNG’s strength is graphics with sharp edges and limited palettes, and that’s exactly where quantization shines.

A note on “real” lossless

Honestly — if you genuinely need every pixel preserved (you’re shipping the asset into a design system, or it’s destined for further editing), stick with optipng and accept the modest savings. For everything that ends up on a website, in a Slack message, or attached to an email, visually lossless is what you actually want.

← All Melt tips