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.tobytes(), 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.1.0.tar.gz (730.7 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.1.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (208.4 kB view details)

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

File details

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

File metadata

  • Download URL: qoi_rs-2.1.0.tar.gz
  • Upload date:
  • Size: 730.7 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.1.0.tar.gz
Algorithm Hash digest
SHA256 4ef6c718bd99e8ea5ba897ed846f2ed8ee9967ae5464c4dbdd280f14b818f55f
MD5 f549ed38bab7b10813a0c0139ecbd609
BLAKE2b-256 d53907e1b76ad589833d8bbe6b53a78fa4bf82cb7dfd2d011b8891f1d396e552

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for qoi_rs-2.1.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cab60c2ed05852b28ef2bd2cc35385a1dc8aef85e77267f2d374e50e07eb905a
MD5 7a7dbfe5670a8b727fd4b6d33ba2e560
BLAKE2b-256 95a23bafc1549671f0f591a17d9d0790978c20f09a7611e07cfc260eb1db6294

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