# 使用 Homebrew, apk, apt, dnf, MacPorts, Nix, pacman, zypper, chocolatey, scoop, winget 安装 optipng

查看 optipng 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

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

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install optipng
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install optipng
```

  证据: 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
```

  证据: 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
```

  证据: 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
```

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

- Nix (92%):

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

  证据: 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
```

  证据: 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
```

  证据: openSUSE Tumbleweed package metadata: optipng from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst

### Windows

- Chocolatey (92%):

```sh
choco install OptiPNG
```

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

- Scoop (92%):

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

  证据: 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
```

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

## 软件包事实

- **软件包键:** brew:optipng
- **软件包管理器:** Homebrew
- **版本:** 7.9.1
- **来源摘要:** PNG file optimizer
- **主页:** <https://optipng.sourceforge.net/>
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- optipng (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 7.9.1
## 项目历史与用法

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.

### 项目历史

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.

### 采用历史

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.

### 使用方式

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.

### 为什么软件包爱好者会关心

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.

### 时间线

- 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.

### 来源

- <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>


## 安全说明

narrow executable package without higher-risk signals.

- **Geiger 风险:** 绿色 / 低
- narrow executable package without higher-risk signals

## 其他软件包管理器记录

- 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-4.fc45: normalized package name match | Fedora Rawhide package metadata: optipng from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-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.6: normalized package name match | openSUSE Tumbleweed package metadata: optipng from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-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','openconnect-gui'
- 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


## Combined YAML source

View the package source record on GitHub. [combined/optipng.yml](https://github.com/mxcl/pkgdb/blob/main/combined/optipng.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
