# Install optipng with Homebrew, apk, chocolatey, apt, dnf, MacPorts, Nix, pacman, scoop, winget, zypper

PNG file optimizer. Version 7.9.1 via Homebrew; verified from local package data.

## Install

```sh
sudo av install brew:optipng
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install optipng
```

  Evidence: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install optipng
```

  Evidence: MacPorts ports tree: graphics/optipng/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- apk (92%):

```sh
sudo apk add optipng
```

  Evidence: Alpine Linux edge package indexes: optipng from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz

- Debian apt (92%):

```sh
sudo apt install optipng
```

  Evidence: Debian stable package indexes: optipng from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- dnf (92%):

```sh
sudo dnf install optipng
```

  Evidence: Fedora Rawhide package metadata: optipng from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst

- Nix (92%):

```sh
nix profile install nixpkgs#optipng
```

  Evidence: nixpkgs package indexes: pkgs/by-name/op/optipng/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- pacman (92%):

```sh
sudo pacman -S optipng
```

  Evidence: Arch Linux sync databases: optipng from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

- zypper (92%):

```sh
sudo zypper install optipng
```

  Evidence: openSUSE Tumbleweed package metadata: optipng from https://download.opensuse.org/tumbleweed/repo/oss/repodata/be8d3611d25469107f32075a1697e69ec57a2b850b42348a658cc671ad5ec2b50760d02c3e59524d50da9a11d5be799bdaffba2e166e8ca8858512e3c0bd665d-primary.xml.zst

### Windows

- Chocolatey (92%):

```sh
choco install OptiPNG
```

  Evidence: Chocolatey community package catalog: OptiPNG from http://community.chocolatey.org/api/v2/Packages?$filter=IsLatestVersion&$select=Id&$top=1000&$skiptoken='11','openssh'

- Scoop (92%):

```sh
scoop install main/optipng
```

  Evidence: Scoop official bucket manifest trees: bucket/optipng.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1

- winget (92%):

```sh
winget install --id OptiPNG.OptiPNG -e
```

  Evidence: Windows Package Manager source index: OptiPNG.OptiPNG from https://cdn.winget.microsoft.com/cache/source.msix

## Package facts

- **Package key:** brew:optipng
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/optipng>
- **Version:** 7.9.1
- **Source summary:** PNG file optimizer
- **Homepage:** <https://optipng.sourceforge.net/>
- **Upstream docs:** <https://optipng.sourceforge.net/>
- **License:** Zlib
- **Source archive:** <https://downloads.sourceforge.net/project/optipng/OptiPNG/optipng-7.9.1/optipng-7.9.1.tar.gz>
- **Generated:** 2026-07-08T07:18:31+00:00

## Executables

- optipng (cli)
- optipng (alias)

## Dependencies

- libpng

## Install behavior

- Post-install hook: not defined
- Bottle: available on arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## Freshness

- Page generated: 2026-07-08
- Package-manager version: 7.9.1
- Local data: ok
- Upstream repository: https://optipng.sourceforge.net/
- info: No package-manager update timestamp was available.
- info: Release/tag comparison is only available for GitHub repositories.
## Project history and usage

OptiPNG is a long-running command-line optimizer for PNG files. It recompresses images without information loss, can convert BMP, GIF, PNM, and TIFF inputs to optimized PNG, and also performs PNG integrity checks and corrections.

### Project history

Cosmin Truta introduced OptiPNG on 2001-12-10 as a PNG IDAT recompression tool that repeatedly tried zlib compression and strategy levels together with PNG delta filters. Version 0.3, announced on 2003-02-24, was the first public release and added documentation, many user options, lossless image-type reduction, zlib memory-level iteration, and lower-memory IDAT handling.

The early 0.x series steadily expanded from pure PNG recompression into a practical asset-pipeline utility. Version 0.5 added support for external input formats BMP, GIF, and PNM in 2006; version 0.5.3 added basic TIFF import; version 0.6 added compressed BMP support, APNG safety behavior, and recovery for incomplete IDAT data.

Later releases were shaped as much by security and dependency maintenance as by compression features. The history records repeated libpng and zlib upgrades, parser fixes for GIF, TIFF, and BMP handling, build-system modernization, and, in 2025, the jump from 0.7.9 to 7.9.1 with CMake support and an AsciiDoc manual.

### Adoption history

OptiPNG became one of the standard lossless PNG optimizers distributed by operating-system package managers. The input metadata lists packages across Alpine, Homebrew, Chocolatey, Debian, Fedora, MacPorts, Nix, Arch, Scoop, Ubuntu, winget, and openSUSE, reflecting its role as a common build and release dependency rather than a single-platform image utility.

### How it is used

Developers and designers use `optipng` to shrink PNG assets for websites, applications, documentation, and release bundles while preserving image content. The tool matters in automated pipelines because it is a deterministic CLI: pass files in, choose an optimization level or output location, and receive optimized PNGs suitable for version-controlled assets or packaging.

The underlying PNG optimization problem is subtle: PNG size depends on color type reductions, palette reductions, row filters, zlib strategy, and Huffman-buffer behavior. OptiPNG's package value is that it automates repeated trials over that search space, giving build systems a boring command instead of bespoke compression experiments.

### Why package nerds care

OptiPNG is a classic package-nerd utility: small, C-based, dependency-sensitive, and useful precisely because package ecosystems can put it everywhere. Its revision history is a miniature tour of real-world file-format tooling, where security fixes in image parsers and updates to bundled compression libraries are as important as byte savings.

### Timeline

- 2001-12-10: OptiPNG is introduced.
- 2003-02-24: Version 0.3 is announced as the first public release.
- 2006-01-14: Version 0.5 adds BMP, GIF, and PNM input support.
- 2008-06-15: Version 0.6 adds compressed BMP support, APNG handling safeguards, and incomplete-IDAT recovery.
- 2017-12-27: Version 0.7.7 fixes GIF and TIFF decoder vulnerabilities and updates libpng and zlib.
- 2025-05-20: Version 7.9.1 updates libpng, enables SIMD-optimized libpng builds on selected platforms, adds CMake, and rewrites the manual.

### Related projects

- OptiPNG sits beside other PNG optimizers such as pngcrush and depends conceptually on the PNG format, Deflate, zlib, and libpng. Its own PNG-Tech article explains the filter, reduction, and zlib-strategy space that these tools explore.

### Sources

- <https://formulae.brew.sh/formula/optipng>
- <https://optipng.sourceforge.net/>
- <https://optipng.sourceforge.net/history.txt>
- <https://optipng.sourceforge.net/optipng-7.9.1.man1.html>
- <https://optipng.sourceforge.net/pngtech/optipng.html>


## Security Notes

narrow executable package without higher-risk signals.

- **Geiger risk:** green / low
- narrow executable package without higher-risk signals

## Source Database Details

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** optipng
- **Version Scheme:** 0
- **Revision:** 0
- **Head Version:** HEAD
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** head, stable

## Other Package-Manager Records

- Debian apt - optipng - 0.7.8+ds-1+b1: normalized package name match | Debian stable package indexes: optipng from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | advanced PNG (Portable Network Graphics) optimizer | https://optipng.sourceforge.net/
- Nix - optipng: normalized package name match | nixpkgs package indexes: pkgs/by-name/op/optipng/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - optipng - 0.7.8+ds-1build2: normalized package name match | Ubuntu 24.04 LTS package indexes: optipng from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | advanced PNG (Portable Network Graphics) optimizer | https://optipng.sourceforge.net/
- apk - optipng - 7.9.1-r1: normalized package name match | Alpine Linux edge package indexes: optipng from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Compresses PNG files to a smaller size, without losing any information. | https://optipng.sourceforge.net/
- apk - optipng-doc - 7.9.1-r1: normalized package name match | Alpine Linux edge package indexes: optipng-doc from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Compresses PNG files to a smaller size, without losing any information. (documentation) | https://optipng.sourceforge.net/
- dnf - optipng - 7.9.1-3.fc44: normalized package name match | Fedora Rawhide package metadata: optipng from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst | PNG optimizer and converter | http://optipng.sourceforge.net/
- pacman - optipng - 7.9.1-1: normalized package name match | Arch Linux sync databases: optipng from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | Compresses PNG files to a smaller size, without losing any information. | http://optipng.sourceforge.net/
- zypper - optipng - 7.9.1-1.4: normalized package name match | openSUSE Tumbleweed package metadata: optipng from https://download.opensuse.org/tumbleweed/repo/oss/repodata/be8d3611d25469107f32075a1697e69ec57a2b850b42348a658cc671ad5ec2b50760d02c3e59524d50da9a11d5be799bdaffba2e166e8ca8858512e3c0bd665d-primary.xml.zst | A PNG File Compressor | https://optipng.sourceforge.net/
- MacPorts - optipng: normalized package name match | MacPorts ports tree: graphics/optipng/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1
- Chocolatey - OptiPNG: normalized package name match | Chocolatey community package catalog: OptiPNG from http://community.chocolatey.org/api/v2/Packages?$filter=IsLatestVersion&$select=Id&$top=1000&$skiptoken='11','openssh'
- Scoop - main/optipng: normalized package name match | Scoop official bucket manifest trees: bucket/optipng.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1
- winget - OptiPNG.OptiPNG: normalized package name match | Windows Package Manager source index: OptiPNG.OptiPNG from https://cdn.winget.microsoft.com/cache/source.msix


## Related links

- [Terminal utility packages](https://www.automicvault.com/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Archive and compression packages](https://www.automicvault.com/pkg/archive-compression-tools/) - Matched archive or compression metadata.
- [Networking and protocol packages](https://www.automicvault.com/pkg/networking-protocol-tools/) - Matched network, protocol, or remote-service metadata.
- [Media and graphics packages](https://www.automicvault.com/pkg/media-graphics-tools/) - Matched media, image, audio, video, or graphics metadata.
- [libpng](https://www.automicvault.com/pkg/brew/libpng/) - Runtime dependency declared by Homebrew.
- [pngcrush](https://www.automicvault.com/pkg/brew/pngcrush/) - Shares av.db curated category or tags: cli, image-optimization, lossless-compression, media, png.
- [oxipng](https://www.automicvault.com/pkg/brew/oxipng/) - Shares av.db curated category or tags: cli, image-optimization, media, png.
- [pngnq](https://www.automicvault.com/pkg/brew/pngnq/) - Shares av.db curated category or tags: cli, image-optimization, media, png.
- [pngquant](https://www.automicvault.com/pkg/brew/pngquant/) - Shares av.db curated category or tags: cli, image-optimization, media, png.
- [imageoptim-cli](https://www.automicvault.com/pkg/brew/imageoptim-cli/) - Shares av.db curated category or tags: cli, image-optimization, media.
- [jpegoptim](https://www.automicvault.com/pkg/brew/jpegoptim/) - Shares av.db curated category or tags: cli, image-optimization, media.
- [caesiumclt](https://www.automicvault.com/pkg/brew/caesiumclt/) - Shares av.db curated category or tags: cli, image-optimization, lossless-compression, media.
- [ansilove](https://www.automicvault.com/pkg/brew/ansilove/) - Shares av.db curated category or tags: cli, media, png.

## Combined YAML source

View the package source record on GitHub. [combined/optipng.yml](https://github.com/automic-vault/db/blob/main/combined/optipng.yml)


## Sources

- Nucleus package database
- Geiger risk classifier
- package-page enrichment
- curated package history
- package version freshness
- av.db category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
