Python 3.6+ interface to libheif library
Project description
pillow_heif
A HEIF/HEIC add-on for Pillow using the libheif
library via CFFI
, with binary wheels (Python 3.6-3.9, linux/macos - x64, aarch64).
Mostly based on David Poirier's pyheif. The idea for this plugin came from Christian Bianciotto's pyheif-pillow-opener. Many thanks!
Pull requests are greatly welcome.
Installation
You can install pillow_heif from PyPi:
pip install pillow_heif
or from GitHub:
pip install https://github.com/bigcat88/pillow_heif/archive/master.zip
Installation from source
Linux Ubuntu
sudo add-apt-repository ppa:strukturag/libheif
apt install libffi libheif-dev libde265-dev
pip install git+https://github.com/bigcat88/pillow_heif.git
MacOS
brew install libffi libheif
pip install git+https://github.com/bigcat88/pillow_heif.git
Windows
With Visual Studio 2015+ C Compiler and SDK installed:
set INCLUDE=%INCLUDE%;X:\path\to\libheif\source
set LIB=%LIB%;X:\path\to\libheif\build
pip install git+https://github.com/bigcat88/pillow_heif.git
Example of use as opener
from PIL import Image
from pillow_heif import register_heif_opener
register_heif_opener()
image = Image.open('image.heic')
image.load()
Example of use as reader
from PIL import Image
import pillow_heif
heif_file = pillow_heif.read("ABC.HEIC")
image = Image.frombytes(
heif_file.mode,
heif_file.size,
heif_file.data,
"raw",
heif_file.mode,
heif_file.stride,
)
The HeifFile object
The returned HeifFile
has the following properties:
size
- the size of the image as a(width, height)
tuple of integersbrand
- a list of heif_brand constantshas_alpha
- (bool)presence of alpha channelmode
- the image mode, e.g. "RGB" or "RGBA"bit_depth
- the number of bits in each component of a pixelmetadata
- a list of metadata dictionariescolor_profile
- a color profile dictionarydata
- the raw decoded file data, as bytesstride
- the number of bytes in a row of decoded file data
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pillow_heif-0.1.4.tar.gz
(19.5 MB
view hashes)
Built Distributions
Close
Hashes for pillow_heif-0.1.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | beab86715608b717426d7c9a2f084e72627eda550fb61e4f54b83ef4e403d579 |
|
MD5 | 30cbd337c2d0855b369eeb3178298417 |
|
BLAKE2b-256 | bb1117beaae6f3f2e7360f7474d96d9cee6597083eab929a26920f6ab654ebc2 |
Close
Hashes for pillow_heif-0.1.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d8d70d25826eec70ea0165e83c7e6cd4b5eee7f9ce70d436e511d18fdb08b85 |
|
MD5 | 625771e7278704f4b881d8cff501dfed |
|
BLAKE2b-256 | 1c96430e07b1b22814b34b32c64285066a87db769707d400505612e6d3a45a91 |
Close
Hashes for pillow_heif-0.1.4-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d8361d29c83bde0af1e290aa333afecae159c3c036340f0bfa4d348be59d3d4a |
|
MD5 | 1738e5c8bd81bfd44a9fc12ec35d3c48 |
|
BLAKE2b-256 | 8bb3a13b0c12a7bb3ec3dc203da367ee227146c0e8eb3ca508b8537a81696c96 |
Close
Hashes for pillow_heif-0.1.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 21510295c9f28ebcf6a595a25a7083feb3dcfd29b3607473bd1bcf07aed77ff2 |
|
MD5 | 9045bc7174165fb4dd9114e5f27172df |
|
BLAKE2b-256 | 5157cafcba1454859300c341978662dc8c5901a8a210a49681d19b9ef7836afe |
Close
Hashes for pillow_heif-0.1.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd51c7df27f043b1ad09d0d535088641235925e93d0e89f47cb252fbac519800 |
|
MD5 | 006be751a6a57ecf79bd2e30b0c935de |
|
BLAKE2b-256 | 51e437ea37ccf97769d0d59af4ea13e98f8ee4ecc63752002681d4fc79f7d488 |
Close
Hashes for pillow_heif-0.1.4-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ef0dfe3687e5d95eba222985f5faf0f4b8cbdf5105347db03a4a01699ef89e7 |
|
MD5 | 5e3893247c70eb2d4546c293e2bdea1d |
|
BLAKE2b-256 | e1a3bb2983e01773a6ac26e89df8361681571475b02e982dbb64ac2d5ef14c4e |
Close
Hashes for pillow_heif-0.1.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f9a5e86c43b4105431cdf9a6677eea5bdf3a4cffebafcb35d1a9e93efa9ccec |
|
MD5 | d5a45320c27395dba6811d826c7590d3 |
|
BLAKE2b-256 | 868efa55aeb92862d29768cb78dd7d98caf7b48c315c0f9848c8038af96c9e9d |
Close
Hashes for pillow_heif-0.1.4-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 22fa4f8cf4a954341a901872f895d4646c81c43df8e863e8ec26741adc8a82bd |
|
MD5 | da64454d438986a4e309b6d0a6e576a2 |
|
BLAKE2b-256 | 790dda1ac4a6c02c301c4c6473af078e168e441f7fbfe2cc2eadf45352df22c4 |
Close
Hashes for pillow_heif-0.1.4-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 952967e6834cbd56979b61246e81eac29df4dbd2f6b11d20601efa11a56714a0 |
|
MD5 | a2813525503e40e42d0f5acdd90ae5d4 |
|
BLAKE2b-256 | 036cb6b08020a417169610dd08ca1bd0f079ca7c7f2f8b681021895c89bf9ef9 |
Close
Hashes for pillow_heif-0.1.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e349fba108fb073a0b8bcc75637e95e86286b849ce407ce48d4d36e8051bddb |
|
MD5 | 617a001bcbf04f957ef6c0723a0e115b |
|
BLAKE2b-256 | e16c64ccabcd6760f33a0ff00604c640558ccfcc961937614e871b71fe4d8d91 |
Close
Hashes for pillow_heif-0.1.4-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 383e906825d3637a20694c777b4a6d63ff5d996421d702cf61533145e06d2ef7 |
|
MD5 | 4e9509dc633b091d46e58d3f05ed7eff |
|
BLAKE2b-256 | db09fa478340b18c20629053a94b0227d04cc2010e6ee79789d7f6c702d94278 |
Close
Hashes for pillow_heif-0.1.4-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb45b21b5d2a9c5e29b7cf255480525a2c55243a630dc387a10c65d8bf2c44cf |
|
MD5 | 20dfd8880d32e644f5b8e3d74dbc16d6 |
|
BLAKE2b-256 | 72faea1c6f085574b8e356d0ce2bd5dbb1eb18a302177eb1b459eb0939f71d36 |
Close
Hashes for pillow_heif-0.1.4-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce060f82ab58412f1585c6d6d3f02645aee07b03c59fee65114b9fc420a9b5ae |
|
MD5 | a7471666d86ce5f6d99711847623e28f |
|
BLAKE2b-256 | 76ffda42d50e4b7aeeb1b6fb09ad88cace43f819c3e02a9a62acf94effdb73bf |
Close
Hashes for pillow_heif-0.1.4-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0678b132cf28740ed6652b01636081a4020d8787fe821b094f01712380067111 |
|
MD5 | e0843c74f26778c79c6eef086670e9ca |
|
BLAKE2b-256 | 01cfe5029758eac97de412f55c1cd3c1b42159234fbcee8a6bb018ceec5b46dd |
Close
Hashes for pillow_heif-0.1.4-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 64b21c7ad691c18dea2df34cef8c1fdb4eb659cf80a520745f9299f66d8f8699 |
|
MD5 | f34fc3fadcd73d58631b1ca462c8a6e7 |
|
BLAKE2b-256 | 982d8ca97f6fa07f8c1164583212e9fc8c5add9309fdb16fa3d14ae43d7e6f92 |