Encode or Decode Blurhash strings in a PySide2/6 project.
Project description
blurhash-pyside
Blurhash encoding and decoding for PySide2/6. This is a lightweight wrapper using the C++ encoding and decoding functions provided by Nheko-Reborn/blurhash.
- Encode a QImage or QPixmap into a blurhash string
- Decode a blruhash string into a QImage or QPixmap
For more information about Blurhash visit their official page.
Dependencies
This project has no external dependencies other than that you must provide either PySide2 or PySide6 in your own project.
The library is pre-compiled for popular platforms and recent Python versions. See the Releases or PyPi page for available wheels.
Local Development
Requirements:
- Python 3.9+
- Hatch
- CMake 3.27+
Run the example:
# choose one:
hatch run pyside6:example
# pyside2 may not be available for all python versions or platforms
hatch run pyside2:example
Setup your local environment
Create a repo relative .venv/
dir:
hatch env create
Run the tests:
hatch test
Build the wheel for your platform:
hatch build -t wheel
Recompile the C++ project:
hatch run compile
The cmake
project is not intended to be run on its own but it is possible to do it.
The pybind11
dependency will be available after creating the default virtual environment
and passing its python executable path to cmake
via Python_EXECUTABLE
. Some IDE's may
do this for you when a python environment is activated in their configuration.
Manual CMake build
cmake -S . -B cmake-build-release -G Ninja
cmake --build cmake-build-release -j 8
cmake --install cmake-build-release --prefix src
Acknowledgements
The core C++ code for the blurhash functions was source from https://github.com/Nheko-Reborn/blurhash under the Boost Software License. Some minor modifications were made.
This project is made possible by pybind11 and scikit-build-core. Multi-platform wheels are generated using the cibuildwheel project.
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
Built Distributions
File details
Details for the file blurhash_pyside-1.0.0.tar.gz
.
File metadata
- Download URL: blurhash_pyside-1.0.0.tar.gz
- Upload date:
- Size: 197.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 49a165f2894af55c0d829cb1462bcfe7a0718c39e1a34cf53f7346b012c41ff3 |
|
MD5 | db75b6cae3d4c79b2c654efc3e57fe6b |
|
BLAKE2b-256 | 0b9447f0f665ba82e999dad9d0f94e468dbc024a62702daa4c88db2b84856e3d |
File details
Details for the file blurhash_pyside-1.0.0-cp312-cp312-win_amd64.whl
.
File metadata
- Download URL: blurhash_pyside-1.0.0-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 64.9 kB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6cd0418776a3affc8cfca94705ed58e2c52a3d889fa6766144fb4c08aa78713 |
|
MD5 | f0b75a2b54fa45b82504539a8f07c172 |
|
BLAKE2b-256 | 5ff6d9356c96848770c7c90e03f0d4e0c92ac8a1a10c70d1f3566af69357313b |
File details
Details for the file blurhash_pyside-1.0.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: blurhash_pyside-1.0.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 71.3 kB
- Tags: CPython 3.12, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | db543873a295eea09caa1b599dfb1a7774855030a88de2cec3c984f053b9697a |
|
MD5 | de9419700b2be301c991a4f7839e32fb |
|
BLAKE2b-256 | 7326d23ec76d4a81d0d0219db0ed6c1c223e04ec339003a9ca0f91900e3cf273 |
File details
Details for the file blurhash_pyside-1.0.0-cp312-cp312-macosx_11_0_x86_64.whl
.
File metadata
- Download URL: blurhash_pyside-1.0.0-cp312-cp312-macosx_11_0_x86_64.whl
- Upload date:
- Size: 63.4 kB
- Tags: CPython 3.12, macOS 11.0+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6111bba457823176f894ea529828e1e2000909ae87af21eddde9f1324fb5c96a |
|
MD5 | 7a639ac729144a2b77fe482f6a315f84 |
|
BLAKE2b-256 | 67fe56099290f9db8579df3e7c7b7c2ff7ebf2b3f29704ba13da0cdbfd413c4d |
File details
Details for the file blurhash_pyside-1.0.0-cp312-cp312-macosx_11_0_arm64.whl
.
File metadata
- Download URL: blurhash_pyside-1.0.0-cp312-cp312-macosx_11_0_arm64.whl
- Upload date:
- Size: 57.1 kB
- Tags: CPython 3.12, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a0ef21fbfa873cb678537e479bf097845d5b4617de69cca6eb17b3550e81f08 |
|
MD5 | a2386e6495e9657c75e510c36ce612ca |
|
BLAKE2b-256 | af2861c999d5a4d538e45ae28fe78c77d6c7417e6a6742733c64185f24de8a97 |
File details
Details for the file blurhash_pyside-1.0.0-cp311-cp311-win_amd64.whl
.
File metadata
- Download URL: blurhash_pyside-1.0.0-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 64.7 kB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 42279a8b40f8ecd48ab562b38a142bd738ff58d50bbc4a7256f9bdca1b2175f2 |
|
MD5 | bc1065756f1cf9e74d5ec01fc905fb7d |
|
BLAKE2b-256 | 1debab6d8ccd6d8818a05e0175a95927e290a4aaa6fdf31957a24887161d2a44 |
File details
Details for the file blurhash_pyside-1.0.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: blurhash_pyside-1.0.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 72.4 kB
- Tags: CPython 3.11, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 533aa216897769654c5f18ea26311a265ff4d5c432cf664f92af9d69ac608cfe |
|
MD5 | 39c77c3f14b121c027c89024fa506ab4 |
|
BLAKE2b-256 | 4390dbd658ac94e51cdf12018aa81e85d621a000011e615098bd2475a985a3b2 |
File details
Details for the file blurhash_pyside-1.0.0-cp311-cp311-macosx_11_0_x86_64.whl
.
File metadata
- Download URL: blurhash_pyside-1.0.0-cp311-cp311-macosx_11_0_x86_64.whl
- Upload date:
- Size: 64.7 kB
- Tags: CPython 3.11, macOS 11.0+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e3a1af37c66db330c270c08ce8f1cb817dc5a893f1f595414d168d36eb8b3be7 |
|
MD5 | 61e01c5cd5d551dc159cd893b5c09376 |
|
BLAKE2b-256 | 55a98134b7e27555ac7a82760615b5b82db6366435fd9e80365f6b8c9332dfdb |
File details
Details for the file blurhash_pyside-1.0.0-cp311-cp311-macosx_11_0_arm64.whl
.
File metadata
- Download URL: blurhash_pyside-1.0.0-cp311-cp311-macosx_11_0_arm64.whl
- Upload date:
- Size: 57.7 kB
- Tags: CPython 3.11, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b46c44230dd863223b151efc46a7a082ce471cb99a278855fcb18dc897a64ed0 |
|
MD5 | 8937d45cf1dcf1b8155ee2abf3056e91 |
|
BLAKE2b-256 | d8d748ba483f2385c348890733ae27ab073f76bf8672d03372788f5fc1730e99 |
File details
Details for the file blurhash_pyside-1.0.0-cp310-cp310-win_amd64.whl
.
File metadata
- Download URL: blurhash_pyside-1.0.0-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 63.6 kB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8718396ae12256bad0e3d4405c424bdd8a9adaa2d3fc39294dc5955a84d86e1d |
|
MD5 | d2a515a82c165db204f2dade76da5734 |
|
BLAKE2b-256 | 32c4fc6d28a89be98f400085c20554a012443e668af0578d0426f38afe29e717 |
File details
Details for the file blurhash_pyside-1.0.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: blurhash_pyside-1.0.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 70.5 kB
- Tags: CPython 3.10, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 818c56d736abdb81b0b845703e06c070871e05c68c4b14dcb7f9eecebdbd4e37 |
|
MD5 | 7b04654e6e9ce2992d974bf3da815f69 |
|
BLAKE2b-256 | 097809630ceeafb03219ecc503aeef95b1c5628a9d82ea51b2f04679fab30357 |
File details
Details for the file blurhash_pyside-1.0.0-cp310-cp310-macosx_11_0_x86_64.whl
.
File metadata
- Download URL: blurhash_pyside-1.0.0-cp310-cp310-macosx_11_0_x86_64.whl
- Upload date:
- Size: 63.3 kB
- Tags: CPython 3.10, macOS 11.0+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3674a124ab9c47800aa349aec65c9e30c8053e23c9d1c67463cef1f0b13a1e2a |
|
MD5 | 1bf4401f7a2c00b6cd185b8c4d804eb9 |
|
BLAKE2b-256 | 7c6b2beac51f5deda3bf32eae7d8040e083ccf968683015f51a002cde85824e7 |
File details
Details for the file blurhash_pyside-1.0.0-cp310-cp310-macosx_11_0_arm64.whl
.
File metadata
- Download URL: blurhash_pyside-1.0.0-cp310-cp310-macosx_11_0_arm64.whl
- Upload date:
- Size: 56.5 kB
- Tags: CPython 3.10, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d522afcdd364b84f145a7e6721f673aef4f531645ff1b9eeba778b8cade7179 |
|
MD5 | 2eefe0d2733b3877b6d43eb3b5369284 |
|
BLAKE2b-256 | 5b3ffbc5d0625e21a5dbc9ff0f96b8d950762f58736ba4485c0a620f2f97b237 |
File details
Details for the file blurhash_pyside-1.0.0-cp39-cp39-win_amd64.whl
.
File metadata
- Download URL: blurhash_pyside-1.0.0-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 63.2 kB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4595f924c32248afdc73ba548e528c9ea28b8ecf5c29ac74cb09b218b37610a6 |
|
MD5 | 8e6d18f20241cefddc85417b2fc79992 |
|
BLAKE2b-256 | ba8d7e1880de109ad5e67efdf3429f8a3bdd88021e2ffb58eb051336ba33537e |
File details
Details for the file blurhash_pyside-1.0.0-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: blurhash_pyside-1.0.0-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 70.6 kB
- Tags: CPython 3.9, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e32652f3e0772aa2b8e15d6fa5b2857e802aaa3f33fb72dc2004eda7b4217217 |
|
MD5 | 6a5054a43bfab867099e959317a7133f |
|
BLAKE2b-256 | f37320a154e3ca868a42a546e76ebd539d29d8c36743af8da2ca4bd94bf0452b |
File details
Details for the file blurhash_pyside-1.0.0-cp39-cp39-macosx_11_0_x86_64.whl
.
File metadata
- Download URL: blurhash_pyside-1.0.0-cp39-cp39-macosx_11_0_x86_64.whl
- Upload date:
- Size: 63.4 kB
- Tags: CPython 3.9, macOS 11.0+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ab3910998a98eace927cc3142343ed84abe8d7ac0d7ac59a51f2ce28626daf1 |
|
MD5 | c0316d786f238d4449fe30a0b43f8a8f |
|
BLAKE2b-256 | db3a9377862f0120141a4bdb3160e7b86f2c22e5e2ec07f6380440a3f778a722 |
File details
Details for the file blurhash_pyside-1.0.0-cp39-cp39-macosx_11_0_arm64.whl
.
File metadata
- Download URL: blurhash_pyside-1.0.0-cp39-cp39-macosx_11_0_arm64.whl
- Upload date:
- Size: 56.6 kB
- Tags: CPython 3.9, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 43d69d65e190d15f67b10175907b26d18ee4da39e200b2fa9f2ea5aba20384a7 |
|
MD5 | 140b237d4ff9bcb1c163b73010beabce |
|
BLAKE2b-256 | d88b0065b1db07cf2a9532e752cb75e51a32a6050234a5fcffca11d428e9cbb9 |