# 使用 Homebrew, apt, MacPorts, Nix, pacman, zypper 安装 img2pdf

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

## 安装

```sh
sudo av install brew:img2pdf
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install img2pdf
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install img2pdf
```

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

### Linux

- Debian apt (92%):

```sh
sudo apt install img2pdf
```

  证据: Debian stable package indexes: img2pdf from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- Nix (92%):

```sh
nix profile install nixpkgs#img2pdf
```

  证据: nixpkgs package indexes: img2pdf from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix

- pacman (92%):

```sh
sudo pacman -S img2pdf
```

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

- zypper (92%):

```sh
sudo zypper install python313-img2pdf
```

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

## 软件包事实

- **软件包键:** brew:img2pdf
- **软件包管理器:** Homebrew
- **版本:** 0.6.3
- **来源摘要:** Convert images to PDF via direct JPEG inclusion
- **主页:** <https://gitlab.mister-muffin.de/josch/img2pdf>
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- img2pdf (别名)
- img2pdf-gui (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

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

img2pdf is a Python CLI and library for lossless conversion of raster images into PDF. Its central trick is treating PDF as a container for image data whenever possible, avoiding the re-encoding that makes many image-to-PDF workflows slower, larger, or lossy.

### 项目历史

The changelog records an initial 0.1.0 packaging entry in March 2014, followed by public PyPI uploads beginning in 2014. The project moved from GitHub to gitlab.mister-muffin.de in the 0.2.0 development line documented in 2015.

The README frames img2pdf around three priorities: always lossless, small output, and fast conversion. It directly contrasts that with conventional conversion tools such as ImageMagick, which may re-encode images, inflate output, or consume more CPU and memory.

Over time the project added Python 3 support, reproducible output options, multipage and palette image handling, CCITT Group 4 TIFF direct copying, PDF/A-1b output, pikepdf support, pathlib input, JBIG2 support, and a minimal tkinter GUI.

### 采用历史

img2pdf spread through both Python and operating-system package channels. Its README documents pip installation, source installation, Debian and Ubuntu repository installation, and Windows executables from the project's release page.

Homebrew formula metadata shows bottled distribution for the CLI on macOS and Linux. PyPI metadata supplies the Python-library distribution path, making img2pdf useful both in scripts and as a dependency inside larger document-processing programs.

### 使用方式

At the command line, users pass one or more image files and write a PDF with -o, or stream a single image from standard input to standard output. The README includes a SANE scanimage pipeline that turns a scan directly into a PDF.

As a library, callers use img2pdf.convert with filenames, file handles, pathlib paths, globs, or in-memory image data. Options cover page layout, DPI, rotation handling, and PDF/A output.

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

img2pdf is package-nerd significant because it solves a common automation problem with a precise format insight: for JPEG, JPEG2000, suitable PNG, CCITT Group 4 TIFF, and JBIG2 cases, the best conversion is often not conversion at all, but direct embedding.

That makes it a favorite kind of small package: easy to install, easy to shell-script, and technically sharper than larger generic image suites for its particular job.

### 时间线

- 2014: 0.1.0 records the initial PyPI packaging work; 0.1.1 changes the license from GPL to LGPL.
- 2015: 0.2.0 moves the project to gitlab.mister-muffin.de and adds a larger test suite and standard-input support.
- 2018: 0.3.1 directly copies CCITT Group 4 TIFF images into PDF containers.
- 2020: 0.4.0 adds PDF/A-1b support, pikepdf support, ICC profile handling, and a rewritten test suite.
- 2023: 0.5.0 changes thumbnail behavior and accepts pathlib.Path objects as input.
- 2025: 0.6.0 adds JBIG2 support; 0.6.3 adds pyproject.toml and merges the jp2 module.

### Related projects

- Pillow supplies image metadata and fallback conversion support.
- pikepdf is an optional PDF engine used in newer img2pdf releases.
- ImageMagick is the comparison point named by the README for conventional image-to-PDF conversion.
- SANE scanimage is shown in the README as part of a scanner-to-PDF pipeline.

### 来源

- <https://formulae.brew.sh/api/formula/img2pdf.json>
- <https://gitlab.mister-muffin.de/josch/img2pdf>
- <https://gitlab.mister-muffin.de/josch/img2pdf/raw/branch/main/CHANGES.rst>
- <https://gitlab.mister-muffin.de/josch/img2pdf/raw/branch/main/README.md>
- <https://pypi.org/pypi/img2pdf/json>


## 安全说明

broad file, network, media, or database tool signal.

- **Geiger 风险:** blue / 中
- broad file, network, media, or database tool signal

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

- Debian apt - img2pdf - 0.6.1-1: normalized package name match | Debian stable package indexes: img2pdf from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Lossless conversion of raster images to PDF | https://gitlab.mister-muffin.de/josch/img2pdf
- Debian apt - python3-img2pdf - 0.6.1-1: normalized package name match | Debian stable package indexes: python3-img2pdf from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Lossless conversion of raster images to PDF (library) | https://gitlab.mister-muffin.de/josch/img2pdf
- Nix - img2pdf: normalized package name match | nixpkgs package indexes: img2pdf from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix
- Ubuntu apt - img2pdf - 0.5.1-1: normalized package name match | Ubuntu 24.04 LTS package indexes: img2pdf from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Lossless conversion of raster images to PDF | https://gitlab.mister-muffin.de/josch/img2pdf
- Ubuntu apt - python3-img2pdf - 0.5.1-1: normalized package name match | Ubuntu 24.04 LTS package indexes: python3-img2pdf from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Lossless conversion of raster images to PDF (library) | https://gitlab.mister-muffin.de/josch/img2pdf
- pacman - img2pdf - 0.6.3-1: normalized package name match | Arch Linux sync databases: img2pdf from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | Losslessly convert raster images to PDF | https://gitlab.mister-muffin.de/josch/img2pdf
- zypper - python313-img2pdf - 0.6.3-3.1: normalized package name match | openSUSE Tumbleweed package metadata: python313-img2pdf from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Python module for converting images to PDF via direct JPEG inclusion | https://gitlab.mister-muffin.de/josch/img2pdf
- zypper - python314-img2pdf - 0.6.3-3.1: normalized package name match | openSUSE Tumbleweed package metadata: python314-img2pdf from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Python module for converting images to PDF via direct JPEG inclusion | https://gitlab.mister-muffin.de/josch/img2pdf
- MacPorts - img2pdf: normalized package name match | MacPorts ports tree: graphics/img2pdf/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/img2pdf.yml](https://github.com/mxcl/pkgdb/blob/main/combined/img2pdf.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
