# Install leptonica with Homebrew, apk, dnf, MacPorts, Nix, pacman, zypper

Image processing and image analysis library. Version 1.87.0 via Homebrew; verified from local package data. Also installable with nix: nix profile install nixpkgs#leptonica.

## Install

```sh
sudo av install brew:leptonica
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install leptonica
```

  Evidence: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install leptonica
```

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

### Linux

- apk (92%):

```sh
sudo apk add leptonica
```

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

- dnf (92%):

```sh
sudo dnf install leptonica
```

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

- Nix (92%):

```sh
nix profile install nixpkgs#leptonica
```

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

- pacman (92%):

```sh
sudo pacman -S leptonica
```

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

- zypper (92%):

```sh
sudo zypper install leptonica-devel
```

  Evidence: openSUSE Tumbleweed package metadata: leptonica-devel from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst

## Package facts

- **Package key:** brew:leptonica
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/leptonica>
- **Version:** 1.87.0
- **Source summary:** Image processing and image analysis library
- **Homepage:** <http://www.leptonica.org/>
- **Repository:** <https://github.com/DanBloomberg/leptonica>
- **Upstream docs:** <http://www.leptonica.org/>
- **License:** BSD-2-Clause
- **Source archive:** <https://github.com/DanBloomberg/leptonica/releases/download/1.87.0/leptonica-1.87.0.tar.gz>
- **Generated:** 2026-08-04T22:13:35+00:00

## Executables

- convertfilestopdf (cli)
- convertfilestops (cli)
- convertformat (cli)
- convertsegfilestopdf (cli)
- convertsegfilestops (cli)
- converttopdf (cli)
- converttops (cli)
- fileinfo (cli)
- imagetops (cli)
- xtractprotos (cli)
- convertfilestopdf (alias)
- convertfilestops (alias)
- convertformat (alias)
- convertsegfilestopdf (alias)
- convertsegfilestops (alias)
- converttopdf (alias)
- converttops (alias)
- fileinfo (alias)
- imagetops (alias)
- xtractprotos (alias)

## Dependencies

- giflib
- jpeg-turbo
- libpng
- libtiff
- openjpeg
- webp

## Build dependencies

- pkgconf

## 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-08-04
- Package-manager version: 1.87.0
- Local data: ok
- Upstream repository: https://github.com/DanBloomberg/leptonica
- info: No package-manager update timestamp was available.
- info: No cached GitHub release or tag data was available.
## Project history and usage

Leptonica is Dan Bloomberg's open source C library for image processing and image analysis, with especially deep coverage of document-image operations used by OCR and page-processing tools.

### Project history

Leptonica's official README metadata dates the work to 2001 and describes it as an open source C library for efficient image processing and image analysis. The project site emphasizes a pedagogical style: the code is accompanied by web pages explaining algorithms and design methods.

The library grew into a broad C toolkit covering raster operations, affine and projective transforms, morphology, convolution, connected components, image format I/O, PDF and PostScript generation, document cleanup, skew detection, dewarping, barcode experiments, and many supporting data structures.

### Adoption history

Leptonica became important infrastructure below OCR and document-image projects. Its README lists Tesseract OCR, OpenCV, and jbig2enc among open source projects that use it.

The project's packaging history reflects a classic C-library role: distributions ship the library, headers, command-line utilities, and example programs so higher-level tools can depend on a stable native image-processing base.

### How it is used

Developers link against liblept and use the pix-centered API for reading, transforming, analyzing, and writing images. The package also includes command-line programs such as file conversion and PDF/PostScript helpers that expose common library workflows.

### Why package nerds care

Leptonica is significant because it is one of those quiet dependency packages that makes OCR stacks work. It is small enough to feel like a C utility library, but large enough to cover thousands of image-processing functions and the boring portability details that downstream packages need.

### Timeline

- 2001: Official metadata identifies Leptonica as an open source C library for image processing and image analysis.
- 2010s: Leptonica moved into GitHub-based maintenance, with contributors preserving old distributions and modernizing build support.
- 2024: Version 1.85.0 added PDF rendering support and many maintenance fixes.
- 2025: Version 1.87.0 was distributed on December 24, 2025.

### Related projects

- Tesseract OCR is a major downstream user.
- OpenCV and jbig2enc are listed by Leptonica as open source projects using the library.

### Sources

- <https://github.com/DanBloomberg/leptonica>
- <https://www.leptonica.org/>
- <https://www.leptonica.org/source/README.html>
- <https://www.leptonica.org/source/version-notes.html>


## Security Notes

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

- **Geiger risk:** blue / medium
- broad file, network, media, or database tool signal

## Source Database Details

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

## Other Package-Manager Records

- Nix - leptonica: normalized package name match | nixpkgs package indexes: pkgs/by-name/le/leptonica/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- apk - leptonica - 1.87.0-r0: normalized package name match | Alpine Linux edge package indexes: leptonica from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Software that is broadly useful for image processing and image analysis applications | http://www.leptonica.com/
- apk - leptonica-dev - 1.87.0-r0: normalized package name match | Alpine Linux edge package indexes: leptonica-dev from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Software that is broadly useful for image processing and image analysis applications (development files) | http://www.leptonica.com/
- apk - leptonica-doc - 1.87.0-r0: normalized package name match | Alpine Linux edge package indexes: leptonica-doc from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Software that is broadly useful for image processing and image analysis applications (documentation) | http://www.leptonica.com/
- dnf - leptonica - 1.87.0-5.fc45: normalized package name match | Fedora Rawhide package metadata: leptonica from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/210a2053c8e007daf9ae39c2a21daaed9b2ddd07d63ecffa597050361e73650c-primary.xml.zst | C library for efficient image processing and image analysis operations | https://github.com/danbloomberg/leptonica
- dnf - leptonica-devel - 1.87.0-5.fc45: normalized package name match | Fedora Rawhide package metadata: leptonica-devel from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/210a2053c8e007daf9ae39c2a21daaed9b2ddd07d63ecffa597050361e73650c-primary.xml.zst | Development files for leptonica | https://github.com/danbloomberg/leptonica
- dnf - leptonica-tools - 1.87.0-5.fc45: normalized package name match | Fedora Rawhide package metadata: leptonica-tools from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/210a2053c8e007daf9ae39c2a21daaed9b2ddd07d63ecffa597050361e73650c-primary.xml.zst | Leptonica utility tools | https://github.com/danbloomberg/leptonica
- dnf - mingw32-leptonica - 1.87.0-5.fc45: normalized package name match | Fedora Rawhide package metadata: mingw32-leptonica from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/210a2053c8e007daf9ae39c2a21daaed9b2ddd07d63ecffa597050361e73650c-primary.xml.zst | MinGW Windows Leptonica library | https://github.com/danbloomberg/leptonica
- dnf - mingw64-leptonica - 1.87.0-5.fc45: normalized package name match | Fedora Rawhide package metadata: mingw64-leptonica from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/210a2053c8e007daf9ae39c2a21daaed9b2ddd07d63ecffa597050361e73650c-primary.xml.zst | MinGW Windows Leptonica library | https://github.com/danbloomberg/leptonica
- pacman - leptonica - 1.87.0-1: normalized package name match | Arch Linux sync databases: leptonica from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | Software that is broadly useful for image processing and image analysis applications | http://www.leptonica.com
- zypper - leptonica-devel - 1.87.0-1.6: normalized package name match | openSUSE Tumbleweed package metadata: leptonica-devel from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Leptonica Development Files | http://leptonica.org/
- zypper - leptonica-tools - 1.87.0-1.6: normalized package name match | openSUSE Tumbleweed package metadata: leptonica-tools from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Leptonica tools | http://leptonica.org/
- zypper - libleptonica6 - 1.87.0-1.6: normalized package name match | openSUSE Tumbleweed package metadata: libleptonica6 from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Library for image processing and image analysis applications | http://leptonica.org/
- MacPorts - leptonica: normalized package name match | MacPorts ports tree: graphics/leptonica/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1
- Nix - fileinfo: installed executable or alias match | nixpkgs package indexes: pkgs/by-name/fi/fileinfo/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1


## Related links

- [Secret-risk packages](https://pkg.so/secret-risk-packages/) - Has protected-tool coverage, approval-gate, or non-low Geiger security signals.
- [Terminal utility packages](https://pkg.so/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Networking and protocol packages](https://pkg.so/networking-protocol-tools/) - Matched network, protocol, or remote-service metadata.
- [Media and graphics packages](https://pkg.so/media-graphics-tools/) - Matched media, image, audio, video, or graphics metadata.
- [libpng](https://pkg.so/brew/libpng/) - Runtime dependency declared by Homebrew.
- [jpeg-turbo](https://pkg.so/brew/jpeg-turbo/) - Runtime dependency declared by Homebrew.
- [libtiff](https://pkg.so/brew/libtiff/) - Runtime dependency declared by Homebrew.
- [giflib](https://pkg.so/brew/giflib/) - Runtime dependency declared by Homebrew.
- [webp](https://pkg.so/brew/webp/) - Runtime dependency declared by Homebrew.
- [openjpeg](https://pkg.so/brew/openjpeg/) - Runtime dependency declared by Homebrew.
- [pkgconf](https://pkg.so/brew/pkgconf/) - Build dependency declared by Homebrew.
- [tesseract](https://pkg.so/brew/tesseract/) - Popular package that depends on this formula.
- [ghostscript](https://pkg.so/brew/ghostscript/) - Popular package that depends on this formula.
- [mupdf](https://pkg.so/brew/mupdf/) - Popular package that depends on this formula.
- [jbig2enc](https://pkg.so/brew/jbig2enc/) - Popular package that depends on this formula.
- [netpbm](https://pkg.so/brew/netpbm/) - Shares pkgdb curated category or tags: cli, image-processing, media.
- [epsilon](https://pkg.so/brew/epsilon/) - Shares pkgdb curated category or tags: cli, image-processing, media.
- [gifsicle](https://pkg.so/brew/gifsicle/) - Shares pkgdb curated category or tags: cli, image-processing, media.
- [openimageio](https://pkg.so/brew/openimageio/) - Shares pkgdb curated category or tags: cli, image-processing, media.
- [nip4](https://pkg.so/brew/nip4/) - Shares pkgdb curated category or tags: cli, image-processing, media.
- [apngasm](https://pkg.so/brew/apngasm/) - Shares pkgdb curated category or tags: cli, image-processing, media.
- [libsail](https://pkg.so/brew/libsail/) - Shares pkgdb curated category or tags: cli, image-processing, media.
- [imagemagick-full](https://pkg.so/brew/imagemagick-full/) - Both packages work with overlapping file formats or content types. Shared terms: cli, image, image-processing, jpeg, jpeg-turbo.

## Combined YAML source

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


## Sources

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