Skip to main content

Simple HEIF/HEIC images plugin for Pillow base on pyhief library.

Project description

heif-image-plugin

build coverage Py Versions license

Simple HEIF/HEIC images plugin for Pillow base on pyhief library.

Originally based on the pyheif-pillow-opener code from Christian Bianciotto.

Installation

You can install heif-image-plugin from PyPI:

pip install heif-image-plugin

How to use

Just import once before opening an image.

from PIL import Image
import HeifImagePlugin

image = Image.open('test.heic')
image.load()

How to contribute

This is not a big library but if you want to contribute is very easy!

  1. clone the repository git clone https://github.com/uploadcare/heif-image-plugin.git
  2. install all requirements make init
  3. do your fixes or add new awesome features (with tests)
  4. run the tests make test
  5. commit in new branch and make a pull request

Changelog

0.6.1

  • Added compatibility with Pillow 10.1+

0.6.0

  • Minimal supported pyheif is 0.7.1
  • Added downsampling parameter for saving. Works only with subsampling == 2.
  • Transformations support updated to the latest libheif and pyheif

0.5.1

  • Fixed HEIF saving in '1' mode

0.5.0

  • Added HEIF saving support if heif-enc is installed (part of libheif)
  • Fixed HeifImageFile.verify() call
  • Extensions .heic, .avif, .heif, .hif are handled by the plugin

0.4.0

  • Bypass some decoding errors when ImageFile.LOAD_TRUNCATED_IMAGES is True.

0.3.2

  • Depends on latest pyheif.

0.3.1

! This version requires pyheif with pyheif.open API. As of 2021.11.25 this API isn't released and is in pyheif's master. See install-pyheif-master-pillow-latest target in the Makefile to install it.

  • Fixed potential vulnerability with arbitrary data in exif metadata.

0.3.0

! This version requires pyheif with pyheif.open API. As of 2021.11.25 this API isn't released and is in pyheif's master. See install-pyheif-master-pillow-latest target in the Makefile to install it.

  • pyheif.open API is used for lazy images loading.
  • Fixed an error when the plugin tries to load any ISOBMFF files.
  • AVIF files should work before, but now this is official.
  • Patched versions of pyheif and libheif with exposed transformations is supported. In this case opened image isn't transformed on loading and orientation is stored in EXIF Orientation tag like for all other image formats. This is faster and consumes less memory.

0.2.0

  • No need to register, works after import.
  • Fill info['icc_profile'] on loading.
  • Close and release file pointer after loading.
  • Deconding without custom HeifDecoder(ImageFile.PyDecoder).

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

heif-image-plugin-0.6.1.tar.gz (6.8 kB view details)

Uploaded Source

File details

Details for the file heif-image-plugin-0.6.1.tar.gz.

File metadata

  • Download URL: heif-image-plugin-0.6.1.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.6

File hashes

Hashes for heif-image-plugin-0.6.1.tar.gz
Algorithm Hash digest
SHA256 666230fb9b9e7e31c1207b56ded8dde5dbbfc012e77ff368458c03871fc7f91d
MD5 084092a629dca460914e66bb69e0570b
BLAKE2b-256 de2b44c1422760de4470e035369df0d7ae4d3ccdf7eed71c777fd477b2bb6cf9

See more details on using hashes here.

Supported by

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