oxipng(1)
๐ oxipng โ okay bestie, let's talk about this ICONIC lossless PNG compression optimizer
So like, oxipng is literally that girl when it comes to making your PNGs smaller without losing any quality. Lossless compression optimizer, no cap. She's the main character of PNG optimization and honestly? Obsessed. ๐
โจ SYNOPSIS โจ
oxipng [-o|--opt] [-r|--recursive] [--dir] [--out] [--stdout]
[-p|--preserve] [-d|--dry-run] [-s ] [--strip] [--keep] [-a|--alpha]
[-i|--interlace] [--scale16] [-v|--verbose]... [-q|--quiet] [-j|--json]
[-f|--filters] [--fast] [--zc] [--nb] [--nc] [--np] [--ng] [--nx] [--nz]
[--fix] [--force] [-z|--zopfli] [--zi] [--ziwi] [--brute-level]
[--brute-lines] [--timeout] [--max-raw-size] [-t|--threads]
[--sequential] [-h|--help] [-V|--version] <files>
๐ธ DESCRIPTION ๐ธ
A lossless PNG compression optimizer. That's it. That's the vibe. She squeezes your PNGs down to their smallest possible size and never loses a single pixel doing it. ๐
๐ฆ OPTIONS ๐ฆ
Okay so here's the whole menu, bestie. Read it, learn it, love it. ๐
-o,--opt <level>โ [default:2] โ Pick your optimization level preset. Level2is literally the sweet spot: fast and good compression. Lower levels go zoom, higher levels squeeze harder but with increasingly diminishing returns (iykyk). Here's the whole lineup:
0 => --zc 5 -f 0,5 --fast
1 => --zc 10 -f 0,7 --fast
2 => --zc 11 -f 0,1,6,7 --fast
3 => --zc 11 -f 0,1,6,7,8,9 --fast --brute-level 1
--brute-lines 3
4 => --zc 12 -f 0,1,6,7,8,9 --fast --brute-level 1
--brute-lines 4
5 => --zc 12 -f 0,1,6,7,8,9 --brute-level 1
--brute-lines 8
6 => --zc 12 -f 0-9 --brute-level 5
--brute-lines 8
max => (stable alias for the maximum level)
If you manually set a compression option (like zc, f, etc.), it overrides whatever the preset says. Doesn't matter what order you write the args in โ the manual one wins, periodt.
-r,--recursiveโ If you hand her directories, she goes full detective mode and traverses the whole tree, optimizing every PNG she finds (files ending in โ.pngโ or โ.apngโ). Slay.--dir <directory>โ Write your output file(s) into<directory>. Don't worry if it doesn't exist yet โ she'll create it. โ ๏ธ Heads up: this will not preserve the directory structure of your input files when you're using it with--recursive. So like, flat output energy.--out <file>โ Write the output file to<file>. Simple. Clean. Iconic.--stdoutโ Write output tostdout. For the pipe girlies. ๐ซถ-p,--preserveโ Preserve file permissions and timestamps if possible. Respectful queen.-d,--dry-runโ Do not write any files, only show compression results. A little preview moment, no commitment.-sโ Strip safely-removable chunks, same as--strip safe.--strip <mode>โ Strip metadata chunks, where<mode>is one of:
safe => Strip all non-critical chunks, except for the
following:
cICP, iCCP, sRGB, pHYs, acTL, fcTL, fdAT
all => Strip all non-critical chunks
<list> => Strip chunks in the comma-separated list, e.g.
'bKGD,cHRM'
๐จ CAUTION: all will convert APNGs to standard PNGs. So if you had animation dreams, they're gone.
Also please note that some chunks will necessarily be stripped when invalidated by the optimization:
bKGD,sBIT,hIST: Stripped if the color type or bit depth changes. If explicitly retained by--keep, reductions will be disabled.caBX,iDOT: Stripped by default. If explicitly retained by--keep, optimization will be aborted.
The default when --strip is not passed is to keep all chunks that remain valid.
--keep <list>โ Strip all metadata chunks except those in the comma-separated list. The special valuedisplayincludes chunks that affect the image appearance, equivalent to--strip safe.
Example: --keep eXIf,display will strip chunks, keeping only eXIf and those that affect the image appearance. ๐
-a,--alphaโ Do extra optimization on images with an alpha channel by altering the color values of fully transparent pixels. Generally recommended for better compression, but โ ๏ธ be careful: while this is โvisually losslessโ, it is technically a lossy transformation and may be unsuitable for some applications. Know your use case, bestie.-i,--interlace <mode>โ [default:off] โ Set the PNG interlacing mode, where<mode>is one of:
off => Remove interlacing from all images that are
processed
on => Apply Adam7 interlacing on all images that are
processed
keep => Keep the existing interlacing mode of each image
Heads up: interlacing can add 25-50% to the size of an optimized image. Only use it if you believe the benefits outweigh the costs for your use case. It's giving โจ tradeoffs โจ.
--scale16โ Forcibly reduce images with 16 bits per channel to 8 bits per channel. This is a lossy operation but can provide significant savings when you have no need for higher depth. Reduction is performed by scaling the values such that, e.g.0x00FFis reduced to0x01rather than0x00.
Without this flag, 16-bit images will only be reduced in depth if it can be done losslessly.
-v,--verboseโ Show per-file info. Use it multiple times for more detail. The more you ask, the more she tells you. ๐-q,--quietโ Suppress all output messages. Shy mode.-j,--jsonโ Print results as JSON. For the programmatic besties.-f,--filters <list>โ Perform compression trials with each of the given filter types. You can specify a comma-separated list, or a range of values. E.g.-f 0-3is the same as-f 0,1,2,3.
PNG delta filters (apply the same filter to every line):
0 => None (recommended to always include this filter)
1 => Sub
2 => Up
3 => Average
4 => Paeth
Heuristic strategies (try to find the best delta filter for each line):
5 => MinSum Minimum sum of absolute differences
6 => Entropy Smallest Shannon entropy
7 => Bigrams Lowest count of distinct bigrams
8 => BigEnt Smallest Shannon entropy of bigrams
9 => Brute Smallest compressed size (slow)
The default value depends on the optimization level preset.
--fastโ Perform a fast compression evaluation of each enabled filter, followed by a single main compression trial of the best result. Note that this is enabled by default and will only be disabled at level5or above.--zc <level>โ Deflate compression level (0-12) for main compression trials. The levels here are defined by the libdeflate compression library.
The default value depends on the optimization level preset.
--nbโ Do not change bit depth.--ncโ Do not change color type.--npโ Do not convert to indexed and do not modify an existing color palette.--ngโ Do not change to or from grayscale.--nxโ Do not perform any transformations and do not deinterlace by default.--nzโ Do not recompress IDAT unless required due to transformations. Recompression of other compressed chunks (such asiCCP) will also be disabled. โ ๏ธ Note that the combination of--nxand--nzwill fully disable all optimization. Like, she's just standing there.--fixโ Do not perform checksum validation of PNG chunks. This may allow some files with errors to be processed successfully. The output will always have correct checksums. Healing era. ๐--forceโ Write the output even if it is larger than the input. Sometimes you just need her to do it anyway.-z,--zopfliโ Use the much slower but stronger Zopfli compressor for main compression trials. Recommended use is with-o maxand--fast. Slow and thorough, like a proper skincare routine.--zi <iterations>โ [default:15] โ Set the number of iterations to use for Zopfli compression. Using fewer iterations may speed up compression for large files. This option requires--zopflito be set.--ziwi <iterations>โ Stop Zopfli compression after this number of iterations without improvement. Use this in conjunction with a high value for--zito achieve better compression in reasonable time. Patience with boundaries. ๐--brute-level <level>โ Set the libdeflate compression level to use with the Brute filter strategy. Sane values are1-5. Higher values are not necessarily better.--brute-lines <lines>โ Set the number of lines to compress at once with the Brute filter strategy. Sane values are2-16. Higher values are not necessarily better.--timeout <secs>โ Maximum amount of time, in seconds, to spend on optimizations. Oxipng will check the timeout before each transformation or compression trial, and will stop trying to optimize the file if the timeout is exceeded. Note that this does not cut short any operations that are already in progress, so it is currently of limited effectiveness for large files with high compression levels. She's polite about it but she can't teleport.--max-raw-size <bytes>โ Maximum size to allow for the input image. If the raw, decompressed image data (or the file size) of the image exceeds this size, it will be skipped. This is useful for limiting memory usage or avoiding long processing times on large images. The value may be specified with a unit suffix such ask,KB,m,MB, etc.
The decompressed size of an image is roughly equal to width * height * bit-depth / 8. E.g. a 1920x1080 image with 24-bit color depth would be roughly 6MB. Math queen. ๐งฎ
-t,--threads <num>โ Set the maximum number of threads to use. Oxipng uses multithreading to evaluate multiple optimizations on the same file in parallel as well as process multiple files in parallel. You can set this to a lower value if you need to limit memory or CPU usage.
[default: num logical CPUs]
--sequentialโ Process multiple files sequentially rather than in parallel. Use this if you need determinism in the processing order. Note this is not necessary if using--threads 1. Control freak approved. ๐-h,--helpโ Print help (see a summary with-h).-V,--versionโ Print version.<files>โ File(s) to compress. Use-for stdin. ๐ซถ
๐ VERSION ๐
v10.2.1 โ she's at her big girl version era.
๐ AUTHORS ๐
Joshua Holmer <jholmer.in@gmail.com> โ the icon behind the icon. We stan. ๐
So yeah, that's oxipng bestie manual, version 10.2.1, dated 2026-09-02. Go forth and compress. Slay those PNGs. Periodt. ๐
โจ
๐ฆ where this page comes from
- arch rolling: oxipng 10.2.1-1 ยท MIT
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms