zopflipng
Optimize PNG files with Zopfli compression
TLDR
SYNOPSIS
zopflipng [-m] [-q] [--lossytransparent] [options] input output_
DESCRIPTION
zopflipng optimizes PNG files using the Zopfli compression algorithm, which produces deflate-compatible output that works everywhere standard PNG files do. It typically achieves 3-8% smaller files compared to standard PNG optimization tools.The tool strips metadata chunks by default for maximum size reduction, though specific chunks can be preserved with the --keepchunks option. A lossy transparency mode (--lossy_transparent) further reduces file size by optimizing invisible fully-transparent pixels without any visible quality change.zopflipng is intentionally slow, trading compression time for smaller output. It is designed for final-stage optimization in build pipelines rather than interactive use. The -m flag enables additional iterations for even better compression at the cost of more processing time.
PARAMETERS
-m
Compress more: use more iterations (slower but better compression).-q
Quick mode, less thorough compression.-y
Allow overwriting the output file.--iterations N
Number of iterations for compression (default: 15 for small files, 5 for large files).--lossy_transparent
Lossy optimization of fully transparent pixels for smaller file size.--keepchunks CHUNKS
Comma-separated list of metadata chunk names to preserve (e.g., iCCP,sRGB).--keeptime
Keep the original modification time of the input file.--filters TYPES
Filter strategies to try: 0-4, m (minimum sum), e (entropy), p (predefined), b (brute force).--prefix PREFIX
Add prefix to output filenames (may contain a directory path).
CAVEATS
Very slow for large images due to exhaustive compression search. CPU intensive. Best suited for final-stage optimization in build pipelines rather than interactive use. Strips metadata chunks by default.
HISTORY
Zopfli was created by Google for maximum deflate compression. zopflipng applies it to PNG images.
