Skip to main content

Python wrapper for libheif

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cyheif-0.0.5.tar.gz (150.2 kB view details)

Uploaded Source

File details

Details for the file cyheif-0.0.5.tar.gz.

File metadata

  • Download URL: cyheif-0.0.5.tar.gz
  • Upload date:
  • Size: 150.2 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for cyheif-0.0.5.tar.gz
Algorithm Hash digest
SHA256 2f701a434b5689e33e207424d2e05ab2a878cb606cad327b2768eae5bbd8579c
MD5 5c922965931e06cff5cd877613297144
BLAKE2b-256 435b00b727065c362c8b91c2f3fbc95c5e038aafcdf541bb4c574888d9376825

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page