A simpler wrapper around qoi (https://github.com/phoboslab/qoi)
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file qoi-0.0.8.tar.gz.
File metadata
- Download URL: qoi-0.0.8.tar.gz
- Upload date:
- Size: 69.4 kB
- Tags: Source
- Uploaded using 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
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9cbcb49eefc15937a5c7a49277ed46aa586a62277e2512e62046e7cc9d0297d7
|
|
| MD5 |
b864ca3c2cb8aaea79bbeabe8d240421
|
|
| BLAKE2b-256 |
112820a1aa3e5c3564ed875bf897d326cbb6c9ad36c285bba46e0d23703a4445
|
File details
Details for the file qoi-0.0.8-cp310-cp310-win_amd64.whl.
File metadata
- Download URL: qoi-0.0.8-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 33.5 kB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using 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
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aae08c2380d2897da99fabaaa758e6166def137975e848df5a0e8b76f623fad0
|
|
| MD5 |
451e6d793ed72203a1783b9fa81a2896
|
|
| BLAKE2b-256 |
c15cf2f587d5fd06627411a3210d9779e922e5fbbc6bff7ee3eee6e2fdbc4586
|
File details
Details for the file qoi-0.0.8-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- 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
- Upload date:
- Size: 149.7 kB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64, manylinux: glibc 2.5+ x86-64
- Uploaded using 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
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7932678f71aae2f566fe9c64d5ed3f77eefa9e391e93cb1f7585f291d5e27e91
|
|
| MD5 |
1f24d98b2705ff4bcd7b8785f6578f9b
|
|
| BLAKE2b-256 |
9ee5a240b70c66f4d4958176dcf29799d38845d18e5375ff6e3de3657933f448
|
File details
Details for the file qoi-0.0.8-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.
File metadata
- Download URL: qoi-0.0.8-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 143.2 kB
- Tags: CPython 3.10, manylinux: glibc 2.17+ i686, manylinux: glibc 2.5+ i686
- Uploaded using 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
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7174b37e633a39c03e7af9c03cb225519a194eed53920935c3d5ca8b09e9c071
|
|
| MD5 |
e134061ce1dbe39c9871c077c8f3cd48
|
|
| BLAKE2b-256 |
04fc0192495f36a9d38111039f89a064849efb043838215dea684188cc8fa633
|
File details
Details for the file qoi-0.0.8-cp310-cp310-macosx_10_9_x86_64.whl.
File metadata
- Download URL: qoi-0.0.8-cp310-cp310-macosx_10_9_x86_64.whl
- Upload date:
- Size: 33.1 kB
- Tags: CPython 3.10, macOS 10.9+ x86-64
- Uploaded using 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
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
971c5dd30e9dd0be3f87a7b4fe263924a21696760c9f8d3bd459fc16c9a74a8e
|
|
| MD5 |
6487c987bdd5ab5e1cf6ee92cde09c8e
|
|
| BLAKE2b-256 |
1823f03ba0753cb07332fdddd9c29303b663cb1742e84e946a41a8cc292208bd
|
File details
Details for the file qoi-0.0.8-cp39-cp39-win_amd64.whl.
File metadata
- Download URL: qoi-0.0.8-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 33.5 kB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using 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
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bce41a1f5fe923dddc4cf0b11a32b30cace93a6542ca193c9afdbbfb70b7566e
|
|
| MD5 |
525beb08d01256e417b6c7bbf5dcce88
|
|
| BLAKE2b-256 |
4ae6bca25ee8b8611cbefee828e3d6f74e2c151df029d27c61dc4e038c19863b
|
File details
Details for the file qoi-0.0.8-cp39-cp39-win32.whl.
File metadata
- Download URL: qoi-0.0.8-cp39-cp39-win32.whl
- Upload date:
- Size: 28.6 kB
- Tags: CPython 3.9, Windows x86
- Uploaded using 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
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b51ed2fa83a001b80898db7dc66ceb38280e9c0304029cfd8d09a418649bd148
|
|
| MD5 |
21a4d67178aa6dcf51464c249fc14fc5
|
|
| BLAKE2b-256 |
28389924878cbaa633183f4de39d48dea4384f24cfb880c35c6c8ef61a943589
|
File details
Details for the file qoi-0.0.8-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- 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
- Upload date:
- Size: 148.8 kB
- Tags: CPython 3.9, manylinux: glibc 2.17+ x86-64, manylinux: glibc 2.5+ x86-64
- Uploaded using 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
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b8b6c29b58acc698f55fcdaa20a936676ec0f709a901972ef9b4cc266d44eade
|
|
| MD5 |
5f3634f1465eed1b03e2dd95c2287b64
|
|
| BLAKE2b-256 |
124adb406c2ef05e29c5a8788783dc067f32c91d3c56c8de1e8fb50ee6782319
|
File details
Details for the file qoi-0.0.8-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.
File metadata
- Download URL: qoi-0.0.8-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 142.4 kB
- Tags: CPython 3.9, manylinux: glibc 2.17+ i686, manylinux: glibc 2.5+ i686
- Uploaded using 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
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b6acee235ea7dcb9e864846b5b16d628e9ccd81d08dcb35438cbeae741247c7a
|
|
| MD5 |
133118848ec9ad8de045b7cb2f1600d7
|
|
| BLAKE2b-256 |
4c63e6a376235a9e02d6da6012095837c06cca2f6c70fef43e48c3db991f23e7
|
File details
Details for the file qoi-0.0.8-cp39-cp39-macosx_10_9_x86_64.whl.
File metadata
- Download URL: qoi-0.0.8-cp39-cp39-macosx_10_9_x86_64.whl
- Upload date:
- Size: 33.1 kB
- Tags: CPython 3.9, macOS 10.9+ x86-64
- Uploaded using 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
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
296b6a64455123a611e55ed629505eb6f2f9f5f568c164e5a8d430c194ee576c
|
|
| MD5 |
a06f7f511f0637174a820806abcd4879
|
|
| BLAKE2b-256 |
0678157afe879d5a52494a0a0c487a9aa63ea405d4ab47cfcbaaad68b4e74e78
|
File details
Details for the file qoi-0.0.8-cp38-cp38-win_amd64.whl.
File metadata
- Download URL: qoi-0.0.8-cp38-cp38-win_amd64.whl
- Upload date:
- Size: 33.5 kB
- Tags: CPython 3.8, Windows x86-64
- Uploaded using 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
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a4fdd3dd2c043e33ba91e44edeed612da475aea3f25267276978a6e4e771b095
|
|
| MD5 |
b49165c1882650a029a8f834a1c4fa66
|
|
| BLAKE2b-256 |
e901409fe3cb081c16ac78de8f8032370bc4c3ab5d496119556b67b06c5cece3
|
File details
Details for the file qoi-0.0.8-cp38-cp38-win32.whl.
File metadata
- Download URL: qoi-0.0.8-cp38-cp38-win32.whl
- Upload date:
- Size: 28.6 kB
- Tags: CPython 3.8, Windows x86
- Uploaded using 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
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b75dfaeeab0851d2f1d6e2e2ece7bad2bdd29691ea3b7dfd452b8e68f0137a8
|
|
| MD5 |
197da8eaf31ee9f8e3565e95b66a2950
|
|
| BLAKE2b-256 |
89e67b6443ce903ce46470c7eee290a643813b789cf8a51afb3560ef10b0dca0
|
File details
Details for the file qoi-0.0.8-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- 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
- Upload date:
- Size: 155.1 kB
- Tags: CPython 3.8, manylinux: glibc 2.17+ x86-64, manylinux: glibc 2.5+ x86-64
- Uploaded using 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
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6936d1f09750bd22588f0cd96dad001194dc38082fa64ebac2adce99682f66d0
|
|
| MD5 |
fff98325eb138ab8ff728cc455d52d6f
|
|
| BLAKE2b-256 |
a852be3ffb0c9746d7b1e91b0d162c3efe5898e2fabfb752b3250b40beb2b75c
|
File details
Details for the file qoi-0.0.8-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.
File metadata
- Download URL: qoi-0.0.8-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 149.7 kB
- Tags: CPython 3.8, manylinux: glibc 2.17+ i686, manylinux: glibc 2.5+ i686
- Uploaded using 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
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b6b9171d1a54b9c9c07a97ce654ac9676a46646b8d55483f9f026ffacdadfcaf
|
|
| MD5 |
9ec2a0a9aaa03596823bf38319f70c31
|
|
| BLAKE2b-256 |
47bae0f6f93c22bad3475ecd2cb027cbc11cb530fb6935bd7bb04f2d3770ddca
|
File details
Details for the file qoi-0.0.8-cp38-cp38-macosx_10_9_x86_64.whl.
File metadata
- Download URL: qoi-0.0.8-cp38-cp38-macosx_10_9_x86_64.whl
- Upload date:
- Size: 32.3 kB
- Tags: CPython 3.8, macOS 10.9+ x86-64
- Uploaded using 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
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f96ca4d0b3251782792331c4b962f92ea0225d0e5cb10525a629f4738fa0bcd3
|
|
| MD5 |
7b3d21cf8ec5897063f819a07bf7c2de
|
|
| BLAKE2b-256 |
d9d3215fa20fe1abf1992be619c770073f262c68ed4bd5e10543432f5f704def
|
File details
Details for the file qoi-0.0.8-cp37-cp37m-win_amd64.whl.
File metadata
- Download URL: qoi-0.0.8-cp37-cp37m-win_amd64.whl
- Upload date:
- Size: 33.1 kB
- Tags: CPython 3.7m, Windows x86-64
- Uploaded using 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
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
19cea8ccced61d41ebccacaaac117ce1a911ae42154b5fe3f6c199997f529c8f
|
|
| MD5 |
68fc08f0c86573348ea0a14363b82838
|
|
| BLAKE2b-256 |
3cfb1b93b725a49829f0e7a731d1996a3ceec032576164f7371183a142a1abd0
|
File details
Details for the file qoi-0.0.8-cp37-cp37m-win32.whl.
File metadata
- Download URL: qoi-0.0.8-cp37-cp37m-win32.whl
- Upload date:
- Size: 28.3 kB
- Tags: CPython 3.7m, Windows x86
- Uploaded using 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
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
382085b3b794985384782f84618330737579ac6a4da19d4b43cbfd5e77850c56
|
|
| MD5 |
c07db9703f2b3a13be4adf43d5ff5936
|
|
| BLAKE2b-256 |
05e29a8e2b9b091eb640542e2cfc9b8cf5c3223c3518fa32681bb5d7a8111633
|
File details
Details for the file qoi-0.0.8-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- 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
- Upload date:
- Size: 141.3 kB
- Tags: CPython 3.7m, manylinux: glibc 2.17+ x86-64, manylinux: glibc 2.5+ x86-64
- Uploaded using 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
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d4d3a71c9d8c6cfcd0bde73a377787743e91477f7b294c2072a0f84b9e3c3269
|
|
| MD5 |
9afdafd5ebe2bc50fb11ef3106403ac2
|
|
| BLAKE2b-256 |
957d5db84ccc2974e2a8b2080e1491879059e461aa7a48019042c2b5b140bd12
|
File details
Details for the file qoi-0.0.8-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.
File metadata
- Download URL: qoi-0.0.8-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 134.8 kB
- Tags: CPython 3.7m, manylinux: glibc 2.17+ i686, manylinux: glibc 2.5+ i686
- Uploaded using 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
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a0606316ab87c4714b71e82ff40153af5c54b6c1c83e8bff1249d12b3e17c352
|
|
| MD5 |
0b061d9fadd5d81f1f9d6b20435e492b
|
|
| BLAKE2b-256 |
232f1b1a79dbcca221fe479ad24ae11379dddfc9c30e51fec55fa925e88bd68d
|
File details
Details for the file qoi-0.0.8-cp37-cp37m-macosx_10_9_x86_64.whl.
File metadata
- Download URL: qoi-0.0.8-cp37-cp37m-macosx_10_9_x86_64.whl
- Upload date:
- Size: 32.0 kB
- Tags: CPython 3.7m, macOS 10.9+ x86-64
- Uploaded using 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
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
53fbb23f476e4b833f375daab1037e98c1a1f2d0863ea96e07069b1ba490b27f
|
|
| MD5 |
cda65648817607556b4087d3c9cf9c36
|
|
| BLAKE2b-256 |
97a6db6550ecb0e609a5acea04dbda32ac5dbf3eb68c24b6a49151ee26830a13
|