Git Product home page Git Product logo

cyheif's Introduction

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. Set the environment variable LIBHEIF_PATH to the folder containing heif.dll in Windows installations (defaults to c:\vcpkg\installed\x64-windows\bin if not set).

cyheif's People

Contributors

ram-nat avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.