# heif-image-plugin
[![build](https://travis-ci.org/uploadcare/heif-image-plugin.svg?branch=master)](https://travis-ci.org/uploadcare/heif-image-plugin)
[![coverage](https://img.shields.io/codecov/c/gh/uploadcare/heif-image-plugin)](https://codecov.io/gh/uploadcare/heif-image-plugin)
[![Py Versions](https://img.shields.io/pypi/pyversions/heif-image-plugin)](https://pypi.python.org/pypi/heif-image-plugin/)
[![license](https://img.shields.io/github/license/uploadcare/heif-image-plugin)](https://pypi.python.org/pypi/heif-image-plugin/)
Simple HEIF/HEIC images plugin for [Pillow](https://pillow.readthedocs.io)
base on [pyhief](https://github.com/carsales/pyheif#pyheif) library.
Originally based on the [pyheif-pillow-opener](https://github.com/ciotto/pyheif-pillow-opener)
code from Christian Bianciotto.
## Installation
You can install **heif-image-plugin** from *PyPI*:
`pip install heif-image-plugin`
### Install libheif binaries for saving capabilities
Ubuntu:
`apt install libheif-examples libheif-plugin-x265 libheif-plugin-aomenc`
## How to use
Just import once before opening an image.
```python
from PIL import Image, ImageOps
import HeifImagePlugin
image = Image.open('test.heic')
ImageOps.exif_transpose(image, in_place=True)
# requires `heif-enc` binary with installed codecs or plugins
image.save('test.avif')
```
## 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`
1. install all requirements `make init`
1. do your fixes or add new awesome features (with tests)
1. run the tests `make test`
1. commit in new branch and make a pull request
## Changelog
### 0.7.0
* Depends on pyheif>=0.8.0, drop older versions support
### 0.6.2
* Fix for buggy LA mode in libheif 1.17.0 - 1.18.2
* Fix Unsupported color conversion for some images
### 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).
Raw data
{
"_id": null,
"home_page": "https://github.com/uploadcare/heif-image-plugin",
"name": "heif-image-plugin",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "heif, heic, Pillow, plugin, pyhief",
"author": "Alexander Karpinsky",
"author_email": "homm86@gmail.com",
"download_url": "https://github.com/uploadcare/heif-image-plugin/archive/v0.7.0.tar.gz",
"platform": null,
"description": "# heif-image-plugin\n\n[![build](https://travis-ci.org/uploadcare/heif-image-plugin.svg?branch=master)](https://travis-ci.org/uploadcare/heif-image-plugin)\n[![coverage](https://img.shields.io/codecov/c/gh/uploadcare/heif-image-plugin)](https://codecov.io/gh/uploadcare/heif-image-plugin)\n[![Py Versions](https://img.shields.io/pypi/pyversions/heif-image-plugin)](https://pypi.python.org/pypi/heif-image-plugin/)\n[![license](https://img.shields.io/github/license/uploadcare/heif-image-plugin)](https://pypi.python.org/pypi/heif-image-plugin/)\n\nSimple HEIF/HEIC images plugin for [Pillow](https://pillow.readthedocs.io)\nbase on [pyhief](https://github.com/carsales/pyheif#pyheif) library.\n\nOriginally based on the [pyheif-pillow-opener](https://github.com/ciotto/pyheif-pillow-opener)\ncode from Christian Bianciotto.\n\n## Installation\n\nYou can install **heif-image-plugin** from *PyPI*:\n\n`pip install heif-image-plugin`\n\n### Install libheif binaries for saving capabilities\n\nUbuntu:\n\n`apt install libheif-examples libheif-plugin-x265 libheif-plugin-aomenc`\n\n## How to use\n\nJust import once before opening an image.\n\n```python\nfrom PIL import Image, ImageOps\nimport HeifImagePlugin\n\nimage = Image.open('test.heic')\nImageOps.exif_transpose(image, in_place=True)\n# requires `heif-enc` binary with installed codecs or plugins\nimage.save('test.avif')\n```\n\n## How to contribute\n\nThis is not a big library but if you want to contribute is very easy!\n\n 1. clone the repository `git clone https://github.com/uploadcare/heif-image-plugin.git`\n 1. install all requirements `make init`\n 1. do your fixes or add new awesome features (with tests)\n 1. run the tests `make test`\n 1. commit in new branch and make a pull request\n\n\n## Changelog\n\n### 0.7.0\n\n* Depends on pyheif>=0.8.0, drop older versions support\n\n### 0.6.2\n\n* Fix for buggy LA mode in libheif 1.17.0 - 1.18.2\n* Fix Unsupported color conversion for some images\n\n### 0.6.1\n\n* Added compatibility with Pillow 10.1+\n\n### 0.6.0\n\n* Minimal supported pyheif is 0.7.1\n* Added `downsampling` parameter for saving. Works only with `subsampling` == 2.\n* Transformations support updated to the latest libheif and pyheif\n\n### 0.5.1\n\n* Fixed HEIF saving in '1' mode\n\n### 0.5.0\n\n* Added HEIF saving support if `heif-enc` is installed (part of libheif)\n* Fixed `HeifImageFile.verify()` call\n* Extensions .heic, .avif, .heif, .hif are handled by the plugin\n\n### 0.4.0\n\n* Bypass some decoding errors when `ImageFile.LOAD_TRUNCATED_IMAGES` is True.\n\n### 0.3.2\n\n* Depends on latest pyheif.\n\n### 0.3.1\n\n! This version requires pyheif with `pyheif.open` API. As of 2021.11.25 this API\nisn't released and is in pyheif's master. See `install-pyheif-master-pillow-latest`\ntarget in the `Makefile` to install it.\n\n* Fixed potential vulnerability with arbitrary data in exif metadata.\n\n### 0.3.0\n\n! This version requires pyheif with `pyheif.open` API. As of 2021.11.25 this API\nisn't released and is in pyheif's master. See `install-pyheif-master-pillow-latest`\ntarget in the `Makefile` to install it.\n\n* `pyheif.open` API is used for lazy images loading.\n* Fixed an error when the plugin tries to load any ISOBMFF files.\n* AVIF files should work before, but now this is official.\n* Patched versions of `pyheif` and `libheif` with exposed transformations is supported.\n In this case opened image isn't transformed on loading and orientation is stored\n in EXIF `Orientation` tag like for all other image formats.\n This is faster and consumes less memory.\n\n### 0.2.0\n\n* No need to register, works after import.\n* Fill `info['icc_profile']` on loading.\n* Close and release file pointer after loading.\n* Deconding without custom HeifDecoder(ImageFile.PyDecoder).\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Simple HEIF/HEIC images plugin for Pillow base on pyhief library.",
"version": "0.7.0",
"project_urls": {
"Download": "https://github.com/uploadcare/heif-image-plugin/archive/v0.7.0.tar.gz",
"Homepage": "https://github.com/uploadcare/heif-image-plugin"
},
"split_keywords": [
"heif",
" heic",
" pillow",
" plugin",
" pyhief"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "33b68673ca961d2dc9adeef1dc675abac938bc967a325078cf7da9701e829f00",
"md5": "80df73117c8ed78d24811307c94005b7",
"sha256": "884c94043007483a29571aff23b58762d65c522d7550d530b9462cc895187b95"
},
"downloads": -1,
"filename": "heif_image_plugin-0.7.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "80df73117c8ed78d24811307c94005b7",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 7242,
"upload_time": "2024-09-10T15:00:44",
"upload_time_iso_8601": "2024-09-10T15:00:44.830975Z",
"url": "https://files.pythonhosted.org/packages/33/b6/8673ca961d2dc9adeef1dc675abac938bc967a325078cf7da9701e829f00/heif_image_plugin-0.7.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-10 15:00:44",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "uploadcare",
"github_project": "heif-image-plugin",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"lcname": "heif-image-plugin"
}