BlurHash encoder implementation for Python
Project description
blurhash-python
This is an encoder for the BlurHash algorithm. To find out more about BlurHash, see https://github.com/woltapp/blurhash.
Installation
Install blurhash with pip
$ pip install blurhash-python
or pipenv
$ pipenv install blurhash-python
Usage
Create blurhash from image file
import blurhash
with open('image.jpg', 'r') as image_file:
hash = blurhash.encode(image_file, x_components=4, y_components=3)
You can also pass file name as parameter to the function
import blurhash
hash = blurhash.encode('image.jpg', x_components=4, y_components=3)
y_components
and x_components
parameters adjust the amount of
vertical and horizontal AC components in hashed image. Both parameters must
be >= 1
and <= 9
.
Development
Install development requirements and package in editable mode
$ pipenv install --dev
Tests
Run test suite with pytest
in virtual environment
$ pytest
Use tox
to run test suite against all supported python versions
$ tox
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
blurhash-python-1.1.3.tar.gz
(177.5 kB
view hashes)
Built Distributions
Close
Hashes for blurhash_python-1.1.3-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_24_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e8cbd99cba8a7d8315545688578de98d45681ca83468249799184059cb60058e |
|
MD5 | 165e6c0ca10591983f89da021ed29b83 |
|
BLAKE2b-256 | 1ff5018445adc0e309f2364e74f7452402e692ad906a3150eab23ea3a46ca988 |
Close
Hashes for blurhash_python-1.1.3-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_24_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4731358922696ea6e7a34e999eda899d5efe63e3939511de094b21f56ea35f57 |
|
MD5 | 215e86d092aadf3df5d3468bd37458c3 |
|
BLAKE2b-256 | 88d797199ea825b8615cf77f2d34bb78d1ac96606f7b4764a290a6667abde2f5 |
Close
Hashes for blurhash_python-1.1.3-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_24_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e2147d8ff5128d7d387c711d1ba70c50595893f14460ac0746c5699df7605d65 |
|
MD5 | 2324fe08ddd6c01aa73ca1cdb3e9a5c1 |
|
BLAKE2b-256 | aa3b98b1f6e486aaa3a18412b563ff9a0730695e88032f9aa316d7586cda691e |
Close
Hashes for blurhash_python-1.1.3-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_24_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 122699e2364c26bf0a89b502ed306785cb26ddfb7642acbc442d61c875749c5a |
|
MD5 | a060b2f529c84ff5df346e31b853b296 |
|
BLAKE2b-256 | c9f8100df7bbe461d449ea2f9082c62857014c233218b4b14331f792a3b852d5 |
Close
Hashes for blurhash_python-1.1.3-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_24_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa272461e273021ccbe82716a4090a0f57c7aad77120ad36aca76d945e58fbe7 |
|
MD5 | 407b96025e3e3f9ffb832ab76e13c05e |
|
BLAKE2b-256 | ca938cbb2edf3d53477e991bbfec9510b5efec644ddf728d995bae58ef949f76 |
Close
Hashes for blurhash_python-1.1.3-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_24_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 327633a793328f533267593c00183548935db9f8fa88193281b43dac7d4edd4e |
|
MD5 | 32ab07deb1489908741d638438085a79 |
|
BLAKE2b-256 | 3b13c51b429f4c09e9e61dcc95b518ec188787e4553023a10118f89555531413 |
Close
Hashes for blurhash_python-1.1.3-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_24_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 845cfb8c34d959f6fb2740cf37e5f8a7991769e061ba88e941765c5ac68e93ae |
|
MD5 | f3d943d90776eb81cfc8f4311b609ca2 |
|
BLAKE2b-256 | d37897855693f27eafe6773f977c6d4d85ee5b46129b31d1294ebc36e465b6f3 |
Close
Hashes for blurhash_python-1.1.3-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_24_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 301fae02f2c934f127229f22ffad99cdb70c997a939d14c90d778937e68a539c |
|
MD5 | 84b4bb4afcdbd299a25080917c290510 |
|
BLAKE2b-256 | e45a5e60dd813689d499d40775c25d3c46ce834f4c9b9f3fdaa742aa300cecb6 |
Close
Hashes for blurhash_python-1.1.3-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_24_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d6a72fb51975faf7bdb0f12a3acfe0d63e4833b8dfb36b53327d6d9ab1e02a09 |
|
MD5 | 20698f35cd25e67c79a5fea32a988f20 |
|
BLAKE2b-256 | 6f4204e2d780b94cb2eacb289e33eda11d3d3460e37bb04308dfe35100b4ee4f |
Close
Hashes for blurhash_python-1.1.3-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_24_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 642362b85b49c516e602b898b2538626205cc5b253f190661d115361111cf761 |
|
MD5 | 35994cac319d4560ed056ce47f16d8ef |
|
BLAKE2b-256 | 39583eb1a0813d279d91e1a3356e0f349882fb00da9154e6091f593cf1e22c8c |