pi-heif
Python interface for libheif library
What it is and what it does
pi-heif is a lightweight Python wrapper around libheif that adds HEIF/HEIC image decoding to pillow. It is a more permissively-licensed variant focused on read-only operations: it decodes HEIF images but does not support save operations. The package integrates as a pillow plugin, allowing decoded image data to be accessed as NumPy arrays or pillow images.
The package supports color depths from 8 to 12 bits, HDR-to-8-bit conversion, and access to depth images embedded in HEIF containers. It requires only pillow as a runtime dependency and is available as precompiled wheels for CPython 3.10, 3.11, 3.12 across macOS (Intel and ARM), Windows, and Linux platforms, reducing installation friction compared to source builds.
Use it for:
- Convert HEIC photos from iOS devices to other formats using pillow's standard image operations.
- Extract depth maps from HEIF files for computational photography or 3D reconstruction workflows.
- Process high-bit-depth HEIF images (10/12-bit) as NumPy arrays for scientific or image processing pipelines.
- Integrate HEIF support into image processing pipelines that already use pillow without rewriting image-loading code.
- Batch decode HEIC files to standard formats in automated image workflows or media asset management systems.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Decodes HEIF/HEIC image files and integrates with pillow for reading and conversion to other formats, supporting 8/10/12-bit color depths and depth images.
Yes, if you need to read HEIF/HEIC files in Python and accept LGPLv3 copyleft terms. The package is actively maintained, has no known vulnerabilities, and precompiled wheels make installation straightforward. Verify that LGPLv3 licensing is compatible with your project before committing.
Install
pi-heif on PyPI
pip
pip install pi-heifuv
uv add pi-heifpoetry
poetry add pi-heifInstalling pi-heif
Before you install
Medium install friction due to compiled wheels; prebuilt binaries are available for CPython 3.10, 3.11, 3.12 on macOS (Intel and ARM), Windows, and Linux (manylinux and musllinux), reducing build complexity. Repository is active with recent commits.
License in practice
Licensed under LGPLv3 (copyleft), which requires that derivative works and modifications remain under the same license; static linking may trigger additional obligations. Verify compatibility with your project's license before use.
Quickstart
from pi_heif import register_heif_opener
import pillow
register_heif_opener()
# Then use pillow's standard image operations on HEIC files
Requires pillow as a runtime dependency; HEIF decoding depends on the underlying libheif library availability on your system.
Verify before relying
- Whether LGPLv3 copyleft obligations apply to static vs. dynamic linking in your deployment context.
- Performance characteristics and memory usage when decoding large or high-bit-depth HEIF files.
- Compatibility with specific HEIF encoder variants or proprietary extensions beyond the standard.
Package facts
| License | BSD-3-Clause (copyleft) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 1 — pillow |
| Maintenance | actively maintained — 65 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 9,550,183/month — #1,527 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pi_heif-1.4.0-cp310-cp310-macosx_10_15_x86_64.whl; pi_heif-1.4.0-cp310-cp310-macosx_11_0_arm64.whl; pi_heif-1.4.0-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; pi_heif-1.4.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; pi_heif-1.4.0-cp310-cp310-musllinux_1_2_aarch64.whl; pi_heif-1.4.0-cp310-cp310-musllinux_1_2_x86_64.whl; pi_heif-1.4.0-cp310-cp310-win_amd64.whl; pi_heif-1.4.0-cp311-cp311-macosx_10_15_x86_64.whl; pi_heif-1.4.0-cp311-cp311-macosx_11_0_arm64.whl; pi_heif-1.4.0-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; pi_heif-1.4.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; pi_heif-1.4.0-cp311-cp311-musllinux_1_2_aarch64.whl; pi_heif-1.4.0-cp311-cp311-musllinux_1_2_x86_64.whl; pi_heif-1.4.0-cp311-cp311-win_amd64.whl; pi_heif-1.4.0-cp312-cp312-macosx_10_15_x86_64.whl; pi_heif-1.4.0-cp312-cp312-macosx_11_0_arm64.whl; pi_heif-1.4.0-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; pi_heif-1.4.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; pi_heif-1.4.0-cp312-cp312-musllinux_1_2_aarch64.whl; pi_heif-1.4.0-cp312-cp312-musllinux_1_2_x86_64.whl
Keywords: heic, heif, pillow
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
pillow-heifpillow-heif adds HEIF/HEIC image format support…
copyleft · top 5,000 on PyPI
pyheifReads HEIF/HEIC image files and exposes their…
permissive · top 15,000 on PyPI
imagesizeReads image file headers to extract dimensions,…
permissive · top 1,000 on PyPI
pillow-avif-pluginRegisters AVIF image format support with…
permissive · top 5,000 on PyPI
WillowWillow provides a unified API for image…
permissive · top 5,000 on PyPI
pilgramApplies Instagram-style filters and CSS-based…
permissive · top 15,000 on PyPI
pillowPillow adds image processing capabilities to…
permissive · top 100 on PyPI
loadimgLoads and converts images between multiple…
permissive · top 15,000 on PyPI
piexifPiexif reads, writes, and manipulates EXIF…
permissive · top 5,000 on PyPI
pilkitPILKit provides a collection of image…
permissive · top 15,000 on PyPI