pyheif
Python 3.6+ interface to libheif library
What it is and what it does
pyheif is a Python wrapper around the libheif C library that lets you read HEIF and HEIC image files—the modern container formats used by Apple devices. It exposes the decoded image data (pixel bytes, dimensions, color mode) along with metadata and the full container structure, so you can extract images and their properties programmatically.
The package is read-only: it decodes HEIF containers and images but does not write them. It works on Linux and macOS with prebuilt wheels for modern Python versions (3.6+), though building from source requires system libraries. The decoded image data can be passed directly to Pillow for further manipulation or conversion to other formats like JPEG.
Use it for:
- Extract pixel data from iPhone or iPad photos (HEIC format) for processing in Python image libraries.
- Batch convert HEIC files to JPEG or PNG by reading with pyheif and saving via Pillow.
- Access metadata and color profiles embedded in HEIF files for archival or analysis.
- Parse HEIF container structure to enumerate all images, depth maps, and auxiliary images in a single file.
- Integrate HEIC support into web applications or image processing pipelines on Linux servers.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Reads HEIF/HEIC image files and exposes their decoded pixel data, metadata, and container structure through a Python interface to the libheif C library.
Yes, if you need to read HEIC/HEIF files on Linux or macOS. The package is actively maintained, has no known vulnerabilities, and fills a clear gap for Apple image format support. Install friction is moderate due to system library dependencies, but prebuilt wheels ease setup on standard Linux distributions. Not suitable for Windows or write-heavy workflows.
Install
pyheif on PyPI
pip
pip install pyheifuv
uv add pyheifpoetry
poetry add pyheifInstalling pyheif
Before you install
Medium friction: requires precompiled wheels on Linux (manylinux2014 x86_64/aarch64) but needs system libraries (libheif, libde265, libffi) when building from source on macOS or Linux. Repository is active with recent commits and no Windows support.
License in practice
Permissive license allows commercial and private use without restriction, though exact license terms are not specified in the package metadata.
Quickstart
import pyheif
heif_file = pyheif.read("image.HEIC")
print(heif_file.mode, heif_file.size, len(heif_file.data))
Requires libheif, libde265, and libffi system libraries installed; not available on Windows; only reading is supported, not writing.
Verify before relying
- Whether cffi is automatically installed as a dependency or must be pre-installed separately.
- Performance characteristics when processing large HEIF files or containers with many images.
- Exact license identifier (Apache 2.0 inferred from classifier but not confirmed in metadata).
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.6) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 1 — cffi |
| Maintenance | actively maintained — 712 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 163,932/month — #10,561 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pyheif-0.8.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; pyheif-0.8.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; pyheif-0.8.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; pyheif-0.8.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; pyheif-0.8.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; pyheif-0.8.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; pyheif-0.8.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; pyheif-0.8.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; pyheif-0.8.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; pyheif-0.8.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; pyheif-0.8.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; pyheif-0.8.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; pyheif-0.8.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; pyheif-0.8.0-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; pyheif-0.8.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; pyheif-0.8.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Keywords: heif, heic
Tags
More Graphics packages
Pillow adds image processing capabilities to…
permissive · top 100 on PyPI
fonttoolsfonttools manipulates font files in multiple…
permissive · top 1,000 on PyPI
matplotlib-inlineEnables matplotlib figures to display inline…
permissive · top 1,000 on PyPI
pymupdfPyMuPDF extracts, renders, converts, and…
agpl · top 1,000 on PyPI
pypdfium2pypdfium2 is a Python binding to PDFium that…
permissive · top 1,000 on PyPI
altairAltair is a declarative Python library for…
permissive · top 1,000 on PyPI
pi-heifDecodes HEIF/HEIC image files and integrates…
copyleft · top 5,000 on PyPI
pillow-heifpillow-heif adds HEIF/HEIC image format support…
copyleft · top 5,000 on PyPI
imagesizeReads image file headers to extract dimensions,…
permissive · top 1,000 on PyPI
pydicomPydicom reads, modifies, and writes DICOM…
permissive · top 5,000 on PyPI
pyaisDecodes and encodes AIS (Automatic…
permissive · top 15,000 on PyPI
ExifReadExtracts Exif metadata from digital image files…
unclear · top 5,000 on PyPI
loadimgLoads and converts images between multiple…
permissive · top 15,000 on PyPI
qoiA Python wrapper for the QOI (Quite OK Image)…
permissive · top 15,000 on PyPI
pyzbarDecodes one-dimensional barcodes and QR codes…
permissive · top 5,000 on PyPI
piexifPiexif reads, writes, and manipulates EXIF…
permissive · top 5,000 on PyPI