Skip to main content

A decoder of HEIF format of images

Project description

cykooz.heif

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 a 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:

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

Uploaded Source

Built Distributions

cykooz.heif-1.2.0-cp313-cp313-manylinux_2_28_x86_64.whl (5.0 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

cykooz.heif-1.2.0-cp312-cp312-manylinux_2_28_x86_64.whl (5.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

cykooz.heif-1.2.0-cp311-cp311-manylinux_2_28_x86_64.whl (5.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

cykooz.heif-1.2.0-cp310-cp310-manylinux_2_28_x86_64.whl (5.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

cykooz.heif-1.2.0-cp39-cp39-manylinux_2_28_x86_64.whl (5.1 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ x86-64

File details

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

File metadata

  • Download URL: cykooz.heif-1.2.0.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for cykooz.heif-1.2.0.tar.gz
Algorithm Hash digest
SHA256 4dc9402d085ae5ca180340d814c6cf7c465ab5f5b81bd58e9114ce86bca4808a
MD5 70baaf4deb0c6b09eec9110b667609a2
BLAKE2b-256 82266b21db65eba649f98720352164f07a16ac2b60d94b292b7638961112df7e

See more details on using hashes here.

File details

Details for the file cykooz.heif-1.2.0-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for cykooz.heif-1.2.0-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0b64f2caf69385c331a2d06833cac616be1d86ca2b8445ca88ced821143baeb5
MD5 52f1b84fcb9ebe8b582b1e075087bf71
BLAKE2b-256 575a102933570d9739988c82025d5676682fdfb3fef277b09f341d34b785a88d

See more details on using hashes here.

File details

Details for the file cykooz.heif-1.2.0-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for cykooz.heif-1.2.0-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 fe440d1257ed3205167f06d4f823c8cc602c1d9570a9dc5cbdb620b500d7b763
MD5 fedc3a9ba9cb0bd40c2419ed6febd9a5
BLAKE2b-256 712d52467997827d353b8189f3070f1076cb51b493d5fc20a6ac4032714d4416

See more details on using hashes here.

File details

Details for the file cykooz.heif-1.2.0-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for cykooz.heif-1.2.0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7d73685322461f786ac72298980c4ed306c598873bb066a11e689eba05c0ff40
MD5 3c592384f9c18afa958970d19c20357f
BLAKE2b-256 42edb05ab33ce052ba293de5eada937326f00b2f7fbe50c48c0ee172049feab8

See more details on using hashes here.

File details

Details for the file cykooz.heif-1.2.0-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for cykooz.heif-1.2.0-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 30f07ba9dea8eafd5195387cb91aca6c6182bac77273f18c23658cc14c554bdc
MD5 11ee270d5ce56714e647522e8b2e070b
BLAKE2b-256 06fe492338ea2cba710ae7d24a6b0976698577f0b319bcf03a6e39d69afae27d

See more details on using hashes here.

File details

Details for the file cykooz.heif-1.2.0-cp39-cp39-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for cykooz.heif-1.2.0-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 478d1db8497a756674d8cabae340d73399d75a89099b71f7085773d280ffcdb4
MD5 d315f2a962d77c9cda52f150f33eb6c5
BLAKE2b-256 a3d54193374bb688814a76b7d011630a0d079d2841b5fe34db692bffe06b9520

See more details on using hashes here.

Supported by

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