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.
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:
- Download Melt and open it.
- Drag the PNG in.
- Pick a quality — 90 is the highest visually-lossless tier, 80 is the sweet spot for almost everything.
- 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.
More Melt tips
-
Receive iPhone photos as JPG via AirDrop (not HEIC)
AirDropping photos from iPhone keeps landing them as HEIC files on your Mac. Here's how to get them as JPG instead.
-
AVIF on Mac — opening and converting AVIF images
AVIF is the next-gen image format that's even smaller than WebP. Here's how to open and convert AVIF files on macOS.
-
How to batch compress a folder of photos on Mac
Compressing 200 photos one at a time is its own form of suffering. Here's how to batch compress images on macOS.
-
What's the best image format for the web (and how to export it on Mac)?
JPEG, PNG, WebP, AVIF, SVG — they each have a job. Here's how to pick the right one for the web and export it from your Mac.