Skip to main content

Wrapper around https://lib.rs/crates/qoi

Project description

qoi-rs

Python library made using qoi and pyo3.

Usage

With Pillow

from io import BytesIO

from PIL import Image
from qoi_rs import encode, decode

image: Image = ...

qoi_bytes: bytes = encode(image.getdata(), width=image.width, height=image.height)

decoded = decode(qoi_bytes)

assert decoded.width == image.width
assert decoded.height == image.height

decoded_image = Image.frombytes(decoded.mode, (decoded.width, decoded.height), decoded.data)
parsed_decoded = Image.open(BytesIO(qoi_bytes))

assert tuple(decoded_image.getdata()) == tuple(parsed_decoded.getdata())

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

qoi_rs-2.0.1.tar.gz (714.0 kB view details)

Uploaded Source

Built Distribution

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

qoi_rs-2.0.1-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (206.5 kB view details)

Uploaded CPython 3.12+manylinux: glibc 2.17+ x86-64

File details

Details for the file qoi_rs-2.0.1.tar.gz.

File metadata

  • Download URL: qoi_rs-2.0.1.tar.gz
  • Upload date:
  • Size: 714.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for qoi_rs-2.0.1.tar.gz
Algorithm Hash digest
SHA256 b1f03f17073b3aed49230a57f8938d6b8e12f94386d1bb359de2f5d42c72b8c5
MD5 60f27cd203079076de40b9eae019688d
BLAKE2b-256 f1355a437159860ba7e13f986c1c1f937a09a7847f7b07ac33c61d6087bc24f9

See more details on using hashes here.

File details

Details for the file qoi_rs-2.0.1-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for qoi_rs-2.0.1-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c4053562d19722af00cb8b8bfb0c762256c14cad46bacd12d4a9db7749e3f9f3
MD5 31bd094b986ae848e5288b1ec5c1624a
BLAKE2b-256 05a7686a14394bcc29d98e0f3bb7270dc8c98eda52157022dcf377f5a6cd7897

See more details on using hashes here.

Supported by

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