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.0.tar.gz (729.1 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.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (205.9 kB view details)

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

File details

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

File metadata

  • Download URL: qoi_rs-2.0.0.tar.gz
  • Upload date:
  • Size: 729.1 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.0.tar.gz
Algorithm Hash digest
SHA256 15af3f69559954e77df543b89ac07c6ade2279343239334a12a46aa802d1c08a
MD5 b076858c123ef4e3ff347a78879fea7e
BLAKE2b-256 cd41df1622e4a0a626459484e8d726ac5babcf8fa84cd9459db18524ee70cb15

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for qoi_rs-2.0.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d1899463956ef24139043810003e01b33b42191ac73ed7cdce3ee47940337566
MD5 8c365786e396494ffb4f3b91557e7b21
BLAKE2b-256 d815eeb473fd6f258d20a38dfd29652bc75cb08e6b6c960bb73946dcf24ac779

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