Search "PNG compression", top tools claim "lossless", but savings vary wildly: some save 70%, others only 10%.
The difference isn't in who has the more magical algorithm, but that what they call "lossless" is actually not the same thing.
This article first clarifies this distinction, then recommends tools by use case.
First, Distinguish: Two Types of "Lossless"
True Lossless: Pixels Do Not Change at All
PNG is itself a lossless format. Its size is determined by two parts: how pixel data is arranged and how Deflate compression is used, and how much metadata is embedded in the file.
True lossless compression works only in these two areas:
- Change to a more space-saving storage method. For example, if only 200 colors are actually used, switch to palette mode; if there is no transparency, remove the Alpha channel; store grayscale images as grayscale.
- Try better filters and Deflate parameters. The same pixels can result in vastly different file sizes depending on the encoding method. Design tools often don't try hard enough when exporting PNGs.
- Remove metadata. Export software info, timestamps, text comments, thumbnails, etc.
After compression, decoding the image yields pixel-perfectly identical results to the original. The trade-off is that it doesn't save much—it can only squeeze out the "waste" from not being encoded carefully enough.
"Visually Lossless": Actually Lossy Quantization
Tools like TinyPNG and pngquant save a lot because they do something else: reduce the number of colors in the PNG to 256 or fewer (quantization), combined with dithering so it looks fine to the human eye.
This is lossy; the pixels have already changed. It works very well for most web icons and illustrations, and is very worth using; but if you need "pixels to remain absolutely unchanged"—for example, UI slices must strictly match the design draft, screenshots need pixel-level comparison, or assets need to be edited later—you shouldn't use it.
The easiest way to judge if a tool is truly lossless is to compare the original and compressed images using ImageMagick:
compare -metric AE original.png compressed.png null:
An output of0means not a single pixel has changed.
True Lossless PNG Tool Recommendations
Command Line: oxipng (Recommended)
oxipng is a lossless PNG optimizer written in Rust, can be seen as the modern successor to the classic tool OptiPNG:
- Multithreaded and fast, suitable for batch processing.
- Adjust compression level with
-o 0to-o 6(and-o max); higher levels are slower but save more. - Optional
--zopflifor further compression, but much slower. - Squoosh's PNG lossless compression uses it.
bash
brew install oxipng
oxipng -o 2 --strip safe -r ./images # Recursively process directory, only strip non-visual metadata
Command Line: zopflipng (For Extreme File Size)
Google's tool, uses the Zopfli algorithm to redo Deflate compression, usually squeezing out a bit more than oxipng's default, but much slower; large images may take a long time. Best for "compress once, use for a long time" static resources, like website logos or app icons.
Command Line: OptiPNG, pngcrush (Classic)
Both are classic lossless PNG optimizers, still seen in many toolchains. Functionality is largely covered by oxipng, so there's no need to choose them for new projects.
Web: Squoosh
Google's online tool. Select the OxiPNG encoder for PNG lossless (make sure not to check "Reduce palette", that option is lossy color reduction).
The advantage is no installation needed and side-by-side comparison; the downside is only one file at a time, requiring you to rename and replace files yourself after downloading. Suitable for compressing a few images occasionally.
Mac GUI: ImageOptim
An open-source, free classic Mac tool that integrates multiple optimizers like oxipng, Zopfli, and pngcrush, trying them all to get the smallest result. It defaults to lossless mode (lossy options need to be manually enabled).
It offers strong compression, but speed can be slow when all optimizers are running; it also overwrites the original file directly, so it's best to back up before compressing.
Mac GUI: ImgZilla
ImgZilla is an image compression tool for macOS that we built. Its approach to PNG is straightforward:
- Uses oxipng for true lossless compression at level 2 (consistent with Squoosh defaults), balancing speed and size. Pixels remain unchanged and can be verified with the
comparecommand above. - No quantization, no color reduction, no format conversion, no resizing. The result is still PNG.
- Local compression: Filename and path remain unchanged, so no need to update references in code or documentation.
- Just drag the folder: Recursively scans subdirectories, skips hidden files and
node_modules; also handles JPG, GIF, WebP, HEIC, AVIF, and SVG. - Original files go to the Trash by default, right-click "Put Back" to undo if unsatisfied.
- Doesn't force compression on stubborn files: Files with less than 0.4% compression are marked "already minimized" and kept as-is, without consuming free quota.
- Runs entirely locally, no assets are uploaded to any server.
Two points to clarify:
- It doesn't pursue PNG's absolute minimum file size. Level 2 is much faster than
-o maxor Zopfli, at the cost of saving a few percent less. If your need is "compress a logo down to the last byte", zopflipng or ImageOptim are more suitable. - By default, all metadata including color profiles is stripped. Standard sRGB images are unaffected; however, if the image has embedded wide-gamut profiles like Display P3 (common in Mac screenshots or design software exports), stripping them may cause slight color shifts in color-managed software. For images with strict color requirements, you can enable "Preserve EXIF" in settings to keep metadata intact.
Summary Table
| Tool | Type | True Lossless | Batch | Best For |
|---|---|---|---|---|
| oxipng | Command Line | ✅ | ✅ | Developers, build pipelines |
| zopflipng | Command Line | ✅ | Requires script | Extreme size, speed not a priority |
| OptiPNG / pngcrush | Command Line | ✅ | ✅ | Legacy projects |
| Squoosh | Web | ✅ (OxiPNG, no palette reduction) | ❌ One at a time | Occasional compression |
| ImageOptim | Mac App | ✅ (default) | ✅ | Mac users wanting max compression power |
| ImgZilla | Mac App | ✅ | ✅ Drag folder | Batch processing, no path changes, undo support |
| TinyPNG / pngquant | Web / CLI | ❌ Lossy quantization | Varies | Accept slight loss, want smaller size |
How to Choose
- Only pixel changes, willing to use the command line: oxipng, write into build scripts for a permanent solution.
- Compress a single file to the absolute limit: zopflipng.
- Mac GUI batch processing: ImageOptim offers more power; ImgZilla is faster, supports undoing from Trash, and handles other formats too.
- Accept slight loss, want smaller size: TinyPNG / pngquant, but be aware this is no longer lossless.
One final reminder: how much lossless compression saves depends on how the PNG was originally exported. PNGs exported directly from design tools or never processed often contain a lot of waste; already optimized PNGs cannot be squeezed much further—when a tool shows "already minimized", it's already very good, not that the tool is incapable.
ImgZilla currently supports macOS (12.3 and above) and is available on the Mac App Store. The free version allows 10 compressions per day, only counting successful ones—drag a folder full of PNGs in and verify pixel-perfect equivalence with
compare.
