2025-03-14 21:59:59 -06:00
|
|
|
# oxipng
|
|
|
|
|
|
|
|
|
|
> Losslessly improve compression of PNG files.
|
2026-02-18 06:55:01 -07:00
|
|
|
> More information: <https://manned.org/oxipng>.
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Compress a PNG file (overwrites the file by default):
|
|
|
|
|
|
|
|
|
|
`oxipng {{path/to/file.png}}`
|
|
|
|
|
|
|
|
|
|
- Compress a PNG file and save the output to a new file:
|
|
|
|
|
|
|
|
|
|
`oxipng --out {{path/to/output.png}} {{path/to/file.png}}`
|
|
|
|
|
|
|
|
|
|
- Compress all PNG files in the current directory using multiple threads:
|
|
|
|
|
|
|
|
|
|
`oxipng "*.png"`
|
|
|
|
|
|
|
|
|
|
- Compress a file with a set optimization level (default is 2):
|
|
|
|
|
|
2026-02-18 06:55:01 -07:00
|
|
|
`oxipng {{[-o|--opt]}} {{0|1|2|3|4|5|6|max}} {{path/to/file.png}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Set the PNG interlacing type (`0` removes interlacing, `1` applies Adam7 interlacing, `keep` preserves existing interlacing; default is `0`):
|
|
|
|
|
|
2026-02-18 06:55:01 -07:00
|
|
|
`oxipng {{[-i|--interlace]}} {{0|1|keep}} {{path/to/file.png}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Perform additional optimization on images with an alpha channel:
|
|
|
|
|
|
2026-02-18 06:55:01 -07:00
|
|
|
`oxipng {{[-a|--alpha]}} {{path/to/file.png}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Use the much slower but stronger Zopfli compressor with max optimization:
|
|
|
|
|
|
2026-02-18 06:55:01 -07:00
|
|
|
`oxipng {{[-Z|--zopfli]}} {{[-o|--opt]}} max {{path/to/file.png}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Strip all non-critical metadata chunks:
|
|
|
|
|
|
|
|
|
|
`oxipng --strip all {{path/to/file.png}}`
|