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.12.tar.gz (7.7 kB view details)

Uploaded Source

Built Distributions

cykooz.heif-0.12-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.12-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.12-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.12-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.12.tar.gz.

File metadata

  • Download URL: cykooz.heif-0.12.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.4

File hashes

Hashes for cykooz.heif-0.12.tar.gz
Algorithm Hash digest
SHA256 999da4b52b4a4c8dd0d4914ad3a85808c80277d8f84b8ef77842c9e5ef890d2c
MD5 51a5360d9a0bd84d92a281e66a785a59
BLAKE2b-256 dc257e8cebd21685a50da5da1484a8a8bc9b1ea924a720c13ceb3f770e1a6078

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cykooz.heif-0.12-cp310-cp310-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 b622b3b597cb210e7c6e1478a991024a4c609259102600eaf392b1a41af873ab
MD5 6e1fcf76c5bf73c5744def8dceb4f6ab
BLAKE2b-256 f5624720ca58b1834b22afd5308717ec35df90e6ae69b14c9751cae1cf6ed277

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cykooz.heif-0.12-cp39-cp39-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 6021e335c3e9e58cd0fdd2ed833e42597695679fa0ddf0ecb79609a75e4b0f7e
MD5 9755ed3770b51afd03aef8fb4a20fc33
BLAKE2b-256 e56921bb0656ca9d4ce1dc733983bd68d91ed315d051809c0b962ead62e58303

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cykooz.heif-0.12-cp38-cp38-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 533e937d3a654df629f2663f2a27701189b08e7f62b860228aab9a69ecd71a2a
MD5 fd99809e9f0f9c4049aaa5f970f4b2d1
BLAKE2b-256 45021cfb4d8584e9188c729f8dbd6cbac236464af230a74595ff4d16f5e2ee5d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cykooz.heif-0.12-cp37-cp37m-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 96f0fc1eee89ddcf6438cfe5028b14fa59e2beb0ed671d5b753ba5a0df6a1080
MD5 d1d2aab122d2387ebf1bd7d44c027c10
BLAKE2b-256 7f19d50bec25d13ad86051195febb613d80876186d7abf01262a8a8a4492ada9

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