Skip to main content

CyHeif - Cython based Python binding for libheif

Purpose

HEIF and HEIC read and write support for Python using LibHeif that works across platforms (Windows and Linux) and has write support for EXIF metadata and HEIC output. This package provides Cython based Python binding for libheif allowing access to High-Efficiency Image Format from Python. One of the main goals for CyHeif is that it should work on Windows and allow for manipulating HEIF/HEIC images from Python in Windows. It works on Windows (unlike PyHeif) and Linux. This is currently barebones but has the critical elements in place and adding functionality for working with HEIF/HEIC files and exposing them to Python as Pillow Images for manipulation.

Functionality

Supports the following:

  • Reading a HEIC file into a Pillow Image
  • Reading the EXIF metadata from a HEIC file into a Pillow Image.Exif
  • Updating the EXIF metadata from a HEIC file and writing it back as HEIC
  • Writing a Pillow Image out as a HEIC file
  • Use Pillow functionality for other image manipulations - resize, transforms etc.

Known Issues

No Documentation - working on it. No binary distributions yet - help welcome to create these. See example/run.py for usage of key functionality.

Requirements

You need a compiled, installed, working, accessible version of heif.dll on Windows. You will also need a working C compiler. To get a C compiler, you can download the Microsoft Visual Studio Community Edition.

You can compile and install libheif on Windows through vcpkg by running the following command:

    vcpkg.exe install libheif --triplet x64-windows

More details on vcpkg is available here.

On Linux, Ubuntu based distributions can install libheif and libheif-dev with the following commands:

sudo apt install libheif
sudo apt install libheif-dev

Once the installation is successful, you should be able to use the extension module by running pip install. See example/run.py for how to use this extension module.

Metadata

Release files for cyheif 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cyheif 0.0.5
File Size Uploaded
cyheif-0.0.5.tar.gz 150.2 kB Details

Release files / cyheif-0.0.5.tar.gz

Download URL cyheif-0.0.5.tar.gz
Size 150.2 kB
Tags Source
SHA-256 checksum
How to use checksums
2f701a434b5689e33e207424d2e05ab2a878cb606cad327b2768eae5bbd8579c
BLAKE2b-256 checksum
How to use checksums
435b00b727065c362c8b91c2f3fbc95c5e038aafcdf541bb4c574888d9376825
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.22.0 requests-toolbelt/0.8.0 tqdm/4.62.3 CPython/3.8.10

Release history Release notifications | RSS feed

This release

0.0.5 This release

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page