# 使用 Homebrew, apk, dnf, MacPorts, Nix, pacman, zypper 安装 libpng

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

## 安装

```sh
sudo av install brew:libpng
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install libpng
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install libpng
```

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

### Linux

- apk (92%):

```sh
sudo apk add libpng
```

  证据: Alpine Linux edge package indexes: libpng from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz

- dnf (92%):

```sh
sudo dnf install libpng
```

  证据: Fedora Rawhide package metadata: libpng 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#libpng
```

  证据: nixpkgs package indexes: pkgs/by-name/li/libpng/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- pacman (92%):

```sh
sudo pacman -S libpng
```

  证据: Arch Linux sync databases: libpng from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

- zypper (92%):

```sh
sudo zypper install libpng12-0
```

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

## 软件包事实

- **软件包键:** brew:libpng
- **软件包管理器:** Homebrew
- **版本:** 1.6.58
- **来源摘要:** Library for manipulating PNG images
- **主页:** <https://www.libpng.org/pub/png/libpng.html>
- **仓库:** <https://github.com/pnggroup/libpng>
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- libpng-config (别名)
- libpng16-config (别名)
- png-fix-itxt (别名)
- pngfix (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

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

libpng is the official Portable Network Graphics reference library. It is the C library most closely associated with reading, writing, testing, and demonstrating PNG behavior across free and proprietary software.

### 项目历史

libpng began in 1995 during the early PNG effort, when the image format was designed as a patent-unencumbered replacement path for GIF-era workflows. The upstream README credits Guy Eric Schalnat as the original author and former maintainer, followed by Andreas Dilger, Glenn Randers-Pehrson, and Cosmin Truta.

The README's historical notes say libpng was in extensive use and testing from mid-1995, that 0.89 was the first official release in 1996, and that 1.0.0 was released in March 1998 after API churn had settled. Later history focused on keeping the public API stable while hiding internal structures and moving callers toward accessor functions.

### 采用历史

libpng's adoption follows PNG itself: once PNG became a web and graphics interchange staple, the reference library became a common dependency for image viewers, browsers, toolkits, converters, and build systems.

The upstream home page emphasizes that libpng supports almost all PNG features, is extensible, and has been tested for more than 30 years. That longevity is why distributions treat it as base image infrastructure rather than an optional graphics experiment.

### 使用方式

Developers use libpng to read, inspect, transform, and write PNG streams from C and C-compatible languages. The package also ships small tools such as `pngfix` and config helpers used by builds.

The manual, example.c, pngtest.c, and bundled test images make libpng both a production library and a reference implementation that other encoders and decoders can compare against.

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

libpng is one of the canonical small C libraries that sits underneath a surprising amount of desktop, web, and server software. Its packaging details matter because a security fix or ABI break can affect a large image-processing dependency graph.

It is also a reference-library package in the strict sense: package maintainers are not just shipping any PNG implementation, but the implementation maintained by the PNG development community as the official reference library.

### 时间线

- 1995-03-29: The CHANGES file records libpng version 0.1.
- 1996-06-05: The CHANGES file records version 0.89, described by the README as the first official release.
- 1998-03-08: The CHANGES file records version 1.0.0.
- 2011: The 1.5 line made direct access to png_struct and png_info private, according to the README's historical notes.
- 2018: The README credits Cosmin Truta as maintainer beginning in 2018.

### Related projects

- PNG is the image format that libpng implements and documents alongside the W3C, RFC, and ISO/IEC specifications.
- zlib is libpng's compression dependency for DEFLATE data inside PNG files.
- png-mng-implement is the mailing-list community referenced by upstream for implementation questions.

### 来源

- <https://raw.githubusercontent.com/pnggroup/libpng/libpng16/CHANGES>
- <https://raw.githubusercontent.com/pnggroup/libpng/libpng16/README>
- <https://www.libpng.org/pub/png/libpng.html>
- <https://www.libpng.org/pub/png/pngdocs.html>
- <https://www.libpng.org/pub/png/pnghist.html>


## 安全说明

library-like package without higher-risk signals.

- **Geiger 风险:** 绿色 / 低
- library-like package without higher-risk signals

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

- Nix - libpng: normalized package name match | nixpkgs package indexes: pkgs/by-name/li/libpng/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- apk - libpng - 1.6.58-r1: normalized package name match | Alpine Linux edge package indexes: libpng from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | Portable Network Graphics library | http://www.libpng.org
- apk - libpng-dev - 1.6.58-r1: normalized package name match | Alpine Linux edge package indexes: libpng-dev from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | Portable Network Graphics library (development files) | http://www.libpng.org
- apk - libpng-doc - 1.6.58-r1: normalized package name match | Alpine Linux edge package indexes: libpng-doc from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | Portable Network Graphics library (documentation) | http://www.libpng.org
- apk - libpng-static - 1.6.58-r1: normalized package name match | Alpine Linux edge package indexes: libpng-static from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | Portable Network Graphics library (static library) | http://www.libpng.org
- apk - libpng-utils - 1.6.58-r1: normalized package name match | Alpine Linux edge package indexes: libpng-utils from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | Portable Network Graphics library (pngfix utils) | http://www.libpng.org
- dnf - libpng - 1.6.58-2.fc45: normalized package name match | Fedora Rawhide package metadata: libpng from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | A library of functions for manipulating PNG image format files | http://www.libpng.org/pub/png/
- dnf - libpng-devel - 1.6.58-2.fc45: normalized package name match | Fedora Rawhide package metadata: libpng-devel from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Development tools for programs to manipulate PNG image format files | http://www.libpng.org/pub/png/
- dnf - libpng-static - 1.6.58-2.fc45: normalized package name match | Fedora Rawhide package metadata: libpng-static from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Static PNG image format file library | http://www.libpng.org/pub/png/
- dnf - libpng-tools - 1.6.58-2.fc45: normalized package name match | Fedora Rawhide package metadata: libpng-tools from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Tools for PNG image format file library | http://www.libpng.org/pub/png/
- pacman - libpng - 1.6.58-2: normalized package name match | Arch Linux sync databases: libpng from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | A collection of routines used to create PNG format graphics files | http://www.libpng.org/pub/png/libpng.html
- zypper - libpng12-0 - 1.2.59-6.2: normalized package name match | openSUSE Tumbleweed package metadata: libpng12-0 from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Library for the Portable Network Graphics Format (PNG) | http://www.libpng.org/pub/png/libpng.html
- zypper - libpng16-16 - 1.6.58-1.2: normalized package name match | openSUSE Tumbleweed package metadata: libpng16-16 from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Library for the Portable Network Graphics Format (PNG) | http://www.libpng.org/pub/png/libpng.html
- MacPorts - libpng: normalized package name match | MacPorts ports tree: graphics/libpng/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1


## Combined YAML source

View the package source record on GitHub. [combined/libpng.yml](https://github.com/mxcl/pkgdb/blob/main/combined/libpng.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
