QOI
A simple Python wrapper around qoi, the "Quite OK Image" format.
Install
pip install qoi
Example
import numpy as np
import qoi
# Get your image as a numpy array (OpenCV, Pillow, etc. but here we just create a bunch of noise)
rgb = np.random.randint(low=0, high=255, size=(224, 244, 3)).astype(np.uint8)
# Write it:
_ = qoi.write("/tmp/img.qoi", rgb)
# Read it and check it matches (it should, as we're lossless)
rgb_read = qoi.read("/tmp/img.qoi")
assert np.array_equal(rgb, rgb_read)
# Likewise for encode/decode to/from bytes:
bites = qoi.encode(rgb)
rgb_decoded = qoi.decode(bites)
assert np.array_equal(rgb, rgb_decoded)
Developing
git clone --recursive https://github.com/kodonnell/qoi/
USE_CYTHON=1 pip install -e .[dev]
pytest .
We use cibuildwheel to build all the wheels, which runs in a Github action. If you want to check this succeeds locally, you can try (untested):
cibuildwheel --platform linux .
Finally, when you're happy, submit a PR.
Publish
This currently is all automatic, and just needs a new tag pushed to Github in the vX.X.X format.
TODO:
- Fix the
cythonproject structure. I had to try a bunch of things to get the version (fromsetuptools_scmin) but it feels very fragile. I'd prefer everything in an__init__.py(defining imports and__all__etc.) but that doesn't seem to work. I also don't get why this is working as it is - I feel like there's some package/namespace magic going on (e.g. the files being calledqoi.p*is important), but haven't been able to fix it. See maybe https://stackoverflow.com/questions/33555927/cython-relative-cimport-beyond-main-package-is-not-allowed ? Also, I think our use ofsrcmight be tripping us up (i.e. still valid, but needs more obscure fixing than just out-of-the-box). - Get
cp310-win32building ... - Create a
qoiCLI - Add some benchmarks and compare with
qoi - Automatically create release on github when push a tag v*?
setuptools_scm_git_archive?- Get cibuildwheels to do a build without
--wheeloption to ensure the source distribution is good.
Discussion
Wrap or rewrite?
For now, this is just a simple wrapper. We'll leave the original project to do all the hard work on performance etc., and also maintaining (or not) compatibility or adding new features etc. We make no claims to do any more than that - we're basically just porting that C functionality to (C)Python.
On the name
For now, let's rock with qoi because
- We're already in python, and the
pyinpyqoiseems redundant. For what it's worth,3 < 5. pyqoiseems like a good name for a python-only version of QOI (useful for pypy etc.), which this isn't.qoiis generally new so let's not overthink it for now. We can always rename later if needed.
What's up with ./src?!
See here and here. I didn't read all of it, but yeh, import qoi is annoying when there's also a folder called qoi.
USE_CTYHON=1?
See here. Fair point.
Metadata
Release files for qoi 0.0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| qoi-0.0.8.tar.gz | 69.4 kB | Details |
Built distributions (wheels)
Total release size: 1.6 MB
Release files / qoi-0.0.8.tar.gz
| Download URL | qoi-0.0.8.tar.gz |
|---|---|
| Size | 69.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9cbcb49eefc15937a5c7a49277ed46aa586a62277e2512e62046e7cc9d0297d7
|
|
BLAKE2b-256 checksum How to use checksums |
112820a1aa3e5c3564ed875bf897d326cbb6c9ad36c285bba46e0d23703a4445
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
|
Release files / qoi-0.0.8-cp310-cp310-win_amd64.whl
| Download URL | qoi-0.0.8-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 33.5 kB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
aae08c2380d2897da99fabaaa758e6166def137975e848df5a0e8b76f623fad0
|
|
BLAKE2b-256 checksum How to use checksums |
c15cf2f587d5fd06627411a3210d9779e922e5fbbc6bff7ee3eee6e2fdbc4586
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
|
Release files / qoi-0.0.8-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | qoi-0.0.8-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 149.7 kB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
7932678f71aae2f566fe9c64d5ed3f77eefa9e391e93cb1f7585f291d5e27e91
|
|
BLAKE2b-256 checksum How to use checksums |
9ee5a240b70c66f4d4958176dcf29799d38845d18e5375ff6e3de3657933f448
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
|
Release files / qoi-0.0.8-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
| Download URL | qoi-0.0.8-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl |
|---|---|
| Size | 143.2 kB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-32 Linux glibc 2.5+ x86-32 |
|
SHA-256 checksum How to use checksums |
7174b37e633a39c03e7af9c03cb225519a194eed53920935c3d5ca8b09e9c071
|
|
BLAKE2b-256 checksum How to use checksums |
04fc0192495f36a9d38111039f89a064849efb043838215dea684188cc8fa633
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
|
Release files / qoi-0.0.8-cp310-cp310-macosx_10_9_x86_64.whl
| Download URL | qoi-0.0.8-cp310-cp310-macosx_10_9_x86_64.whl |
|---|---|
| Size | 33.1 kB |
| Tags | CPython 3.10 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
971c5dd30e9dd0be3f87a7b4fe263924a21696760c9f8d3bd459fc16c9a74a8e
|
|
BLAKE2b-256 checksum How to use checksums |
1823f03ba0753cb07332fdddd9c29303b663cb1742e84e946a41a8cc292208bd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
|
Release files / qoi-0.0.8-cp39-cp39-win_amd64.whl
| Download URL | qoi-0.0.8-cp39-cp39-win_amd64.whl |
|---|---|
| Size | 33.5 kB |
| Tags | CPython 3.9 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
bce41a1f5fe923dddc4cf0b11a32b30cace93a6542ca193c9afdbbfb70b7566e
|
|
BLAKE2b-256 checksum How to use checksums |
4ae6bca25ee8b8611cbefee828e3d6f74e2c151df029d27c61dc4e038c19863b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
|
Release files / qoi-0.0.8-cp39-cp39-win32.whl
| Download URL | qoi-0.0.8-cp39-cp39-win32.whl |
|---|---|
| Size | 28.6 kB |
| Tags | CPython 3.9 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
b51ed2fa83a001b80898db7dc66ceb38280e9c0304029cfd8d09a418649bd148
|
|
BLAKE2b-256 checksum How to use checksums |
28389924878cbaa633183f4de39d48dea4384f24cfb880c35c6c8ef61a943589
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
|
Release files / qoi-0.0.8-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | qoi-0.0.8-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 148.8 kB |
| Tags | CPython 3.9 Linux glibc 2.17+ x86-64 Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
b8b6c29b58acc698f55fcdaa20a936676ec0f709a901972ef9b4cc266d44eade
|
|
BLAKE2b-256 checksum How to use checksums |
124adb406c2ef05e29c5a8788783dc067f32c91d3c56c8de1e8fb50ee6782319
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
|
Release files / qoi-0.0.8-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
| Download URL | qoi-0.0.8-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl |
|---|---|
| Size | 142.4 kB |
| Tags | CPython 3.9 Linux glibc 2.17+ x86-32 Linux glibc 2.5+ x86-32 |
|
SHA-256 checksum How to use checksums |
b6acee235ea7dcb9e864846b5b16d628e9ccd81d08dcb35438cbeae741247c7a
|
|
BLAKE2b-256 checksum How to use checksums |
4c63e6a376235a9e02d6da6012095837c06cca2f6c70fef43e48c3db991f23e7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
|
Release files / qoi-0.0.8-cp39-cp39-macosx_10_9_x86_64.whl
| Download URL | qoi-0.0.8-cp39-cp39-macosx_10_9_x86_64.whl |
|---|---|
| Size | 33.1 kB |
| Tags | CPython 3.9 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
296b6a64455123a611e55ed629505eb6f2f9f5f568c164e5a8d430c194ee576c
|
|
BLAKE2b-256 checksum How to use checksums |
0678157afe879d5a52494a0a0c487a9aa63ea405d4ab47cfcbaaad68b4e74e78
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
|
Release files / qoi-0.0.8-cp38-cp38-win_amd64.whl
| Download URL | qoi-0.0.8-cp38-cp38-win_amd64.whl |
|---|---|
| Size | 33.5 kB |
| Tags | CPython 3.8 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
a4fdd3dd2c043e33ba91e44edeed612da475aea3f25267276978a6e4e771b095
|
|
BLAKE2b-256 checksum How to use checksums |
e901409fe3cb081c16ac78de8f8032370bc4c3ab5d496119556b67b06c5cece3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
|
Release files / qoi-0.0.8-cp38-cp38-win32.whl
| Download URL | qoi-0.0.8-cp38-cp38-win32.whl |
|---|---|
| Size | 28.6 kB |
| Tags | CPython 3.8 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
5b75dfaeeab0851d2f1d6e2e2ece7bad2bdd29691ea3b7dfd452b8e68f0137a8
|
|
BLAKE2b-256 checksum How to use checksums |
89e67b6443ce903ce46470c7eee290a643813b789cf8a51afb3560ef10b0dca0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
|
Release files / qoi-0.0.8-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | qoi-0.0.8-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 155.1 kB |
| Tags | CPython 3.8 Linux glibc 2.17+ x86-64 Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
6936d1f09750bd22588f0cd96dad001194dc38082fa64ebac2adce99682f66d0
|
|
BLAKE2b-256 checksum How to use checksums |
a852be3ffb0c9746d7b1e91b0d162c3efe5898e2fabfb752b3250b40beb2b75c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
|
Release files / qoi-0.0.8-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
| Download URL | qoi-0.0.8-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl |
|---|---|
| Size | 149.7 kB |
| Tags | CPython 3.8 Linux glibc 2.17+ x86-32 Linux glibc 2.5+ x86-32 |
|
SHA-256 checksum How to use checksums |
b6b9171d1a54b9c9c07a97ce654ac9676a46646b8d55483f9f026ffacdadfcaf
|
|
BLAKE2b-256 checksum How to use checksums |
47bae0f6f93c22bad3475ecd2cb027cbc11cb530fb6935bd7bb04f2d3770ddca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
|
Release files / qoi-0.0.8-cp38-cp38-macosx_10_9_x86_64.whl
| Download URL | qoi-0.0.8-cp38-cp38-macosx_10_9_x86_64.whl |
|---|---|
| Size | 32.3 kB |
| Tags | CPython 3.8 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
f96ca4d0b3251782792331c4b962f92ea0225d0e5cb10525a629f4738fa0bcd3
|
|
BLAKE2b-256 checksum How to use checksums |
d9d3215fa20fe1abf1992be619c770073f262c68ed4bd5e10543432f5f704def
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
|
Release files / qoi-0.0.8-cp37-cp37m-win_amd64.whl
| Download URL | qoi-0.0.8-cp37-cp37m-win_amd64.whl |
|---|---|
| Size | 33.1 kB |
| Tags | CPython 3.7 CPython 3.7 pymalloc Windows x86-64 |
|
SHA-256 checksum How to use checksums |
19cea8ccced61d41ebccacaaac117ce1a911ae42154b5fe3f6c199997f529c8f
|
|
BLAKE2b-256 checksum How to use checksums |
3cfb1b93b725a49829f0e7a731d1996a3ceec032576164f7371183a142a1abd0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
|
Release files / qoi-0.0.8-cp37-cp37m-win32.whl
| Download URL | qoi-0.0.8-cp37-cp37m-win32.whl |
|---|---|
| Size | 28.3 kB |
| Tags | CPython 3.7 CPython 3.7 pymalloc Windows x86-32 |
|
SHA-256 checksum How to use checksums |
382085b3b794985384782f84618330737579ac6a4da19d4b43cbfd5e77850c56
|
|
BLAKE2b-256 checksum How to use checksums |
05e29a8e2b9b091eb640542e2cfc9b8cf5c3223c3518fa32681bb5d7a8111633
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
|
Release files / qoi-0.0.8-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | qoi-0.0.8-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 141.3 kB |
| Tags | CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.17+ x86-64 Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
d4d3a71c9d8c6cfcd0bde73a377787743e91477f7b294c2072a0f84b9e3c3269
|
|
BLAKE2b-256 checksum How to use checksums |
957d5db84ccc2974e2a8b2080e1491879059e461aa7a48019042c2b5b140bd12
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
|
Release files / qoi-0.0.8-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
| Download URL | qoi-0.0.8-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl |
|---|---|
| Size | 134.8 kB |
| Tags | CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.17+ x86-32 Linux glibc 2.5+ x86-32 |
|
SHA-256 checksum How to use checksums |
a0606316ab87c4714b71e82ff40153af5c54b6c1c83e8bff1249d12b3e17c352
|
|
BLAKE2b-256 checksum How to use checksums |
232f1b1a79dbcca221fe479ad24ae11379dddfc9c30e51fec55fa925e88bd68d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
|
Release files / qoi-0.0.8-cp37-cp37m-macosx_10_9_x86_64.whl
| Download URL | qoi-0.0.8-cp37-cp37m-macosx_10_9_x86_64.whl |
|---|---|
| Size | 32.0 kB |
| Tags | CPython 3.7 CPython 3.7 pymalloc macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
53fbb23f476e4b833f375daab1037e98c1a1f2d0863ea96e07069b1ba490b27f
|
|
BLAKE2b-256 checksum How to use checksums |
97a6db6550ecb0e609a5acea04dbda32ac5dbf3eb68c24b6a49151ee26830a13
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
|