Skip to main content

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.

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 .

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

cykooz.heif-0.13.tar.gz (12.1 kB view details)

Uploaded Source

Built Distributions

cykooz.heif-0.13-cp311-cp311-manylinux_2_24_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.24+ x86-64

cykooz.heif-0.13-cp310-cp310-manylinux_2_24_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.24+ x86-64

cykooz.heif-0.13-cp39-cp39-manylinux_2_24_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.24+ x86-64

cykooz.heif-0.13-cp38-cp38-manylinux_2_24_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.24+ x86-64

cykooz.heif-0.13-cp37-cp37m-manylinux_2_24_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.7m manylinux: glibc 2.24+ x86-64

File details

Details for the file cykooz.heif-0.13.tar.gz.

File metadata

  • Download URL: cykooz.heif-0.13.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.0

File hashes

Hashes for cykooz.heif-0.13.tar.gz
Algorithm Hash digest
SHA256 f560edba043fe41fb13b852579bb119ea7169cf0e9afddd3330790949210861e
MD5 e063f941634f4861f7a79f4408df2993
BLAKE2b-256 305f05dbbc7abbc12975a85f9cd31e1be9d79f913b25c9c438ef6664ec2badbf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cykooz.heif-0.13-cp311-cp311-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 5958991a49185313ed0fb0a41f47fd99fa22cf2d8b79d38f44445686cd24cff5
MD5 f2bd8c4ade9ac1b8dc359fce65ad872f
BLAKE2b-256 d99a0be0805270f0d44dd29e4de54251b17856806140c65e01048150f13a6f8c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cykooz.heif-0.13-cp310-cp310-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 61bfb12c7f082183c4d6281834b25737c440e43df0672aa4469eb9f4525f98d4
MD5 c09a551ad0813cfe66e324db5f2e8164
BLAKE2b-256 b67165c3d9ca075c14b65751e7acd7348a8699106a46b0cd7cb205fd669e69e5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cykooz.heif-0.13-cp39-cp39-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 aca2486f7586d2797dc42d50aec1d5a4fd103e2acdfe478b09c3e7f368d2bdb5
MD5 2841fcce43c3b0a19b37950f03fc3069
BLAKE2b-256 c841f7e59bb0a695ac8d7b131776e2c0dbaecedfb06da6779c9638250c29a2e3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cykooz.heif-0.13-cp38-cp38-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 34c4f16b1264d11b9f87c3da21523f68aa4cbae5e52303de70e713130cb408cf
MD5 440702b6958cd440bb5028fb90d4bd0c
BLAKE2b-256 903d38ea25d5db266b2b64749354d5795e62da9a4daab2d852098d962ca81108

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cykooz.heif-0.13-cp37-cp37m-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 11b44b78298b3d2d2724a2438ab0454892bbebd310801f71078787f317d1be3a
MD5 b0a734e65dfedb647da8fae7d00d77d3
BLAKE2b-256 4f38aea3ece456b963423bbd4ec20b58995a3c22e30c2da2015c8c769eb2e9cd

See more details on using hashes here.

Supported by

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