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.2.tar.gz
(183.9 kB
view hashes)
Built Distributions
Close
Hashes for blurhash_python-1.1.2-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_24_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec33c7e3786696d9ae1e8af051c70bb8c4f963e0a7b2993edb34ff00d834ac27 |
|
MD5 | 3f1c59e492869f7a05105e111c3646eb |
|
BLAKE2b-256 | 799774968e116c8fc9cd2eb58f5e9b1bd4dfbd8db428a407874c8139547ce70f |
Close
Hashes for blurhash_python-1.1.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_24_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 48585f02992d0820894fe582f129a60dcc9ede6c9870498a2bec8e8c541ecd93 |
|
MD5 | f51351bf67642f91b05eee6d24e9f9c5 |
|
BLAKE2b-256 | 30c3ca115c2ac43d2ea4f1833ece16d4d71b2c044fd6abc68456aee1649c3e91 |
Close
Hashes for blurhash_python-1.1.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_24_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0751abdcd882fe7b33015751d468b51f5048a75461e743167d4cb68fce248f1a |
|
MD5 | 77e146791db662ecfcbf628cbad9c110 |
|
BLAKE2b-256 | c20b432f9cabe8307614f00f17c76c6673a3fd8f6c89cd856301e3e9f520696f |
Close
Hashes for blurhash_python-1.1.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_24_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 83c0889f9f34220a97bbada525f5118c822446add8382a0d89f195c8616096c5 |
|
MD5 | f37fae1581be46a56700cca53ccf839a |
|
BLAKE2b-256 | 87146192727b712d364187e9f2c7ae554ba446312b64a70faa4f4d68687a8a53 |
Close
Hashes for blurhash_python-1.1.2-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_24_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6bcf87bfa1a42a0e9627ffe0e898761297c6e4e7bde2dcb7bf4864d89448971 |
|
MD5 | 320bb893df976667c0da65f410fae1f7 |
|
BLAKE2b-256 | 421e7b68cda88d2b1c1383fd75eadcf827d1810eb19486f6df8604ab55f98f7b |
Close
Hashes for blurhash_python-1.1.2-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_24_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7801450fd0844f1cf694d53824c2f8531799be47254ee0f204156ad0c9cee6bc |
|
MD5 | 756fe4b9ca0370988555b17289688a71 |
|
BLAKE2b-256 | 2c38af5e9efe03d4bd6340949dc376a170d9c6384875c55e7b3f1c8537a7edaf |
Close
Hashes for blurhash_python-1.1.2-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_24_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 21373e0a6873313c1709c9823a1c80860a37fd79d8f0f149f15532cd312bb335 |
|
MD5 | e01e22c193e60ee78e26d0c31f8670fb |
|
BLAKE2b-256 | ad2c1c9efa0816211479b45b43d8bf64cc2e2589c74650257ba4c530938deca2 |
Close
Hashes for blurhash_python-1.1.2-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_24_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e2aeb6911870145c8baeef08edec864e9d2c2b913710caf182663fb3e559b24 |
|
MD5 | 09985ad952bbb53b9f8a4092bfc74ad5 |
|
BLAKE2b-256 | a66483149de13233044c056cda7302b38d7d2e12a1eff3dfdf4a63d27171daa0 |