A decoder of HEIF format of images
Project description
cykooz.heif is simple python wrapper for the library libheif-rs.
RawHeifImage is a simple wrapper around low level HEIF-decoder.
Usage Examples
Read HEIF-image from file:
from cykooz.heif.image import RawHeifImage
img = RawHeifImage.from_path('data/test.heif')
assert img.width == 3024
assert img.height == 4032
assert img.mode == 'RGB'
assert len(img.data) == 36578304
assert img.stride == 9072
assert len(img.exif) == 2026
Read HEIF-image from file-like object:
from cykooz.heif.image import RawHeifImage
with open('data/test.heif') as fp
img = RawHeifImage.from_stream(fp)
assert img.width == 3024
assert img.height == 4032
Also package provides an opener plugin for PIL (Pillow):
from PIL import Image
from cykooz.heif.pil import register_heif_opener
register_heif_opener()
img = Image.open('data/test.heif')
assert isinstance(img, Image.Image)
assert img.size == (3024, 4032)
assert img.mode == 'RGB'
assert img.getpixel((100, 100)) == (73, 74, 69)
img.save('test.jpg', 'JPEG')
Installation from source
System requirements:
libheif-dev >= 1.12 (https://github.com/strukturag/libheif)
python3-dev
Rust 1.56+ (https://www.rust-lang.org/)
Ubuntu 22.04
$ sudo add-apt-repository ppa:strukturag/libheif
$ sudo add-apt-repository ppa:strukturag/libde265
$ sudo apt-get install build-essential python3-dev libheif-dev curl
$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
$ source $HOME/.cargo/env
$ pip3 install .
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
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cykooz.heif-0.13.1.tar.gz.
File metadata
- Download URL: cykooz.heif-0.13.1.tar.gz
- Upload date:
- Size: 12.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
64f01526e1dcd5b16a2a740e8e9ce28b76950bfd2a7dfc11c32d235a400d5524
|
|
| MD5 |
4206e95fe01e8f4e30dc14b73187f7b1
|
|
| BLAKE2b-256 |
c4927f60ffdf6c0c824004aa6c84d0cbdc755e3eb5e9789d50fb2f1c35c03c9b
|
File details
Details for the file cykooz.heif-0.13.1-cp311-cp311-manylinux_2_24_x86_64.whl.
File metadata
- Download URL: cykooz.heif-0.13.1-cp311-cp311-manylinux_2_24_x86_64.whl
- Upload date:
- Size: 4.4 MB
- Tags: CPython 3.11, manylinux: glibc 2.24+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cf29b43d11a6ad56e7d2b241d267b7a6d401315ddfb5442334a9a5f90e4e8db6
|
|
| MD5 |
5f0bd520b3ad4ebb60c35e214b121a0a
|
|
| BLAKE2b-256 |
82dadb8982163b71efc8ff997fc4dba595cd600cb8b30df84e4d29e5f639e496
|
File details
Details for the file cykooz.heif-0.13.1-cp310-cp310-manylinux_2_24_x86_64.whl.
File metadata
- Download URL: cykooz.heif-0.13.1-cp310-cp310-manylinux_2_24_x86_64.whl
- Upload date:
- Size: 4.4 MB
- Tags: CPython 3.10, manylinux: glibc 2.24+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f7f1ea27447cf6d7c73178e6abb0adf6cac66483f05fbc10de540661641a9b3d
|
|
| MD5 |
75cc6066d3b349639395b661bde9c02c
|
|
| BLAKE2b-256 |
e637f8f6b7d6c2186ed13a244b5abb7ebd6cb1b4c71d94c1f1c4ecfbd0e0bf96
|
File details
Details for the file cykooz.heif-0.13.1-cp39-cp39-manylinux_2_24_x86_64.whl.
File metadata
- Download URL: cykooz.heif-0.13.1-cp39-cp39-manylinux_2_24_x86_64.whl
- Upload date:
- Size: 4.4 MB
- Tags: CPython 3.9, manylinux: glibc 2.24+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f8d7814cd96caa694e858d225fbf726f0e5033edf3fe4c5277c2cea4a40084e6
|
|
| MD5 |
3d21ff6e3ef389df0e19d9a125b2adf6
|
|
| BLAKE2b-256 |
620fc4d2664385cc9d637166e4264a397d9205a16acad087c43e01281dfe2508
|
File details
Details for the file cykooz.heif-0.13.1-cp38-cp38-manylinux_2_24_x86_64.whl.
File metadata
- Download URL: cykooz.heif-0.13.1-cp38-cp38-manylinux_2_24_x86_64.whl
- Upload date:
- Size: 4.4 MB
- Tags: CPython 3.8, manylinux: glibc 2.24+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f2996c7aa05e7e6073dbc48d888648c531a9e5e46cf6a39b746a643e18c54236
|
|
| MD5 |
8a242dad31c06fcf091ef5c9b6dc3107
|
|
| BLAKE2b-256 |
45754ef2f560037f1b0244982e84d2752370ed003c46c46c0cd5be4fff935117
|
File details
Details for the file cykooz.heif-0.13.1-cp37-cp37m-manylinux_2_24_x86_64.whl.
File metadata
- Download URL: cykooz.heif-0.13.1-cp37-cp37m-manylinux_2_24_x86_64.whl
- Upload date:
- Size: 4.4 MB
- Tags: CPython 3.7m, manylinux: glibc 2.24+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c8424dea6df85c3f15595811e61dae5ef4141e99885b6a29c435ea1fa0e1b053
|
|
| MD5 |
b4882856eeca8030aa8bf0c51a11009c
|
|
| BLAKE2b-256 |
ef1e8ccc8956e40c5a99246c41735591f6b9993a59b990f389222e597b96da1b
|