Skip to main content

cykooz.heif is simple python wrapper for the library libheif-rs.

RawHeifImage is a simple wrapper around low level HEIF-decoder.

CHANGELOG

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:

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 .

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cykooz.heif-0.13.1.tar.gz (12.2 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

cykooz.heif-0.13.1-cp311-cp311-manylinux_2_24_x86_64.whl (4.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.24+ x86-64

cykooz.heif-0.13.1-cp310-cp310-manylinux_2_24_x86_64.whl (4.4 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.24+ x86-64

cykooz.heif-0.13.1-cp39-cp39-manylinux_2_24_x86_64.whl (4.4 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.24+ x86-64

cykooz.heif-0.13.1-cp38-cp38-manylinux_2_24_x86_64.whl (4.4 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.24+ x86-64

cykooz.heif-0.13.1-cp37-cp37m-manylinux_2_24_x86_64.whl (4.4 MB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.24+ x86-64

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

Hashes for cykooz.heif-0.13.1.tar.gz
Algorithm Hash digest
SHA256 64f01526e1dcd5b16a2a740e8e9ce28b76950bfd2a7dfc11c32d235a400d5524
MD5 4206e95fe01e8f4e30dc14b73187f7b1
BLAKE2b-256 c4927f60ffdf6c0c824004aa6c84d0cbdc755e3eb5e9789d50fb2f1c35c03c9b

See more details on using hashes here.

File details

Details for the file cykooz.heif-0.13.1-cp311-cp311-manylinux_2_24_x86_64.whl.

File metadata

File hashes

Hashes for cykooz.heif-0.13.1-cp311-cp311-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 cf29b43d11a6ad56e7d2b241d267b7a6d401315ddfb5442334a9a5f90e4e8db6
MD5 5f0bd520b3ad4ebb60c35e214b121a0a
BLAKE2b-256 82dadb8982163b71efc8ff997fc4dba595cd600cb8b30df84e4d29e5f639e496

See more details on using hashes here.

File details

Details for the file cykooz.heif-0.13.1-cp310-cp310-manylinux_2_24_x86_64.whl.

File metadata

File hashes

Hashes for cykooz.heif-0.13.1-cp310-cp310-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 f7f1ea27447cf6d7c73178e6abb0adf6cac66483f05fbc10de540661641a9b3d
MD5 75cc6066d3b349639395b661bde9c02c
BLAKE2b-256 e637f8f6b7d6c2186ed13a244b5abb7ebd6cb1b4c71d94c1f1c4ecfbd0e0bf96

See more details on using hashes here.

File details

Details for the file cykooz.heif-0.13.1-cp39-cp39-manylinux_2_24_x86_64.whl.

File metadata

File hashes

Hashes for cykooz.heif-0.13.1-cp39-cp39-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 f8d7814cd96caa694e858d225fbf726f0e5033edf3fe4c5277c2cea4a40084e6
MD5 3d21ff6e3ef389df0e19d9a125b2adf6
BLAKE2b-256 620fc4d2664385cc9d637166e4264a397d9205a16acad087c43e01281dfe2508

See more details on using hashes here.

File details

Details for the file cykooz.heif-0.13.1-cp38-cp38-manylinux_2_24_x86_64.whl.

File metadata

File hashes

Hashes for cykooz.heif-0.13.1-cp38-cp38-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 f2996c7aa05e7e6073dbc48d888648c531a9e5e46cf6a39b746a643e18c54236
MD5 8a242dad31c06fcf091ef5c9b6dc3107
BLAKE2b-256 45754ef2f560037f1b0244982e84d2752370ed003c46c46c0cd5be4fff935117

See more details on using hashes here.

File details

Details for the file cykooz.heif-0.13.1-cp37-cp37m-manylinux_2_24_x86_64.whl.

File metadata

File hashes

Hashes for cykooz.heif-0.13.1-cp37-cp37m-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 c8424dea6df85c3f15595811e61dae5ef4141e99885b6a29c435ea1fa0e1b053
MD5 b4882856eeca8030aa8bf0c51a11009c
BLAKE2b-256 ef1e8ccc8956e40c5a99246c41735591f6b9993a59b990f389222e597b96da1b

See more details on using hashes here.

Release history Release notifications | RSS feed

2.0.1

6 files

2.0.0

6 files

1.3.0

6 files

1.2.0

6 files

1.1.0

6 files

1.0.1

6 files

1.0.0

6 files

0.14.0

5 files

This release

0.13.1 This release

6 files

0.13

6 files

0.12

5 files

0.11

5 files

0.10.4

5 files

0.10.2

5 files

0.10

5 files

0.9

5 files

0.8.3

5 files

0.8

5 files

0.7.2

5 files

0.7

5 files

0.6

1 file

Supported by

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