optipng
PNG optimizer that reduces file size without losing quality
TLDR
Optimize PNG file
$ optipng [image.png]
Optimize with maximum compression$ optipng -o7 [image.png]
Optimize multiple files$ optipng [*.png]
Preserve file timestamps$ optipng -preserve [image.png]
Simulate without modifying$ optipng -simulate [image.png]
Strip all metadata$ optipng -strip all [image.png]
Convert to PNG$ optipng [image.bmp]
SYNOPSIS
optipng [options] files...
DESCRIPTION
optipng is a PNG optimizer that reduces file size without losing quality. It recompresses the image data and removes unnecessary metadata.The tool can also convert other formats (BMP, GIF, TIFF) to optimized PNG.
PARAMETERS
-o level
Optimization level (0-7, default 2).-strip objects
Strip metadata (all, exif, icc, etc.).-preserve
Preserve file attributes.-simulate
Dry run, don't modify.-out file
Output to different file.-dir directory
Output directory.-backup
Keep backup of original.-quiet
Quiet mode.-verbose
Verbose output.-fix
Fix corrupt data.-force
Enforce writing of a new output file.-snip
Cut one image out of multi-image or animation files.-nb
Do not apply bit depth reduction.-nc
Do not apply color type reduction.-np
Do not apply palette reduction.-nx
Do not apply any lossless image reduction.-nz
Do not recode IDAT datastreams.-i type
Interlace type (0=non-interlaced, 1=Adam7).-f filters
PNG delta filters (0-5).-zc levels
Zlib compression levels (1-9).-zs strategies
Zlib compression strategies (0-3).-zm levels
Zlib memory levels (1-9).-zw size
Zlib window size (256, 512, 1k, 2k, 4k, 8k, 16k, 32k).
CAVEATS
Higher optimization levels much slower. Lossless only - can't reduce beyond PNG limits. Some metadata may be useful. Original file modified by default.
HISTORY
OptiPNG was created by Cosmin Truta to provide optimal PNG compression. It builds on the zlib and libpng libraries, implementing various optimization strategies to minimize file size.
