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.0.2.tar.gz
(179.7 kB
view hashes)
Built Distributions
Close
Hashes for blurhash_python-1.0.2-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9121222998b6d12821e2c422cbe41485220b0aa85508d48b7b1a12be2696f0ac |
|
MD5 | 46a4578046e6c4e532db2a1a5b88b36a |
|
BLAKE2b-256 | bd021ef56a46269cbf67b884defdf5621ba5273b3e6d77fa3c6b3c84a803b00c |
Close
Hashes for blurhash_python-1.0.2-cp38-cp38-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca3e6e0365d26d5b9a54c0755fe3bc4c0b4088a8f80784e086c39672ef715537 |
|
MD5 | 74232b094c33fa79fc5c407bfdf37151 |
|
BLAKE2b-256 | 6757717ab9a30596c65cbbb9a3d4b58417b17768c9a14c30ee22260f28dbad3d |
Close
Hashes for blurhash_python-1.0.2-cp38-cp38-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f07137ff682cb29d1b4972a4e814912799a5fc43d25e688f8f604023912ecf9e |
|
MD5 | 88703b892c50e9c6903544807294e820 |
|
BLAKE2b-256 | d3c24d3039bf7665f281f1e6eb1a2b3c9da6622f102c489c10f7d4dca91cc99b |
Close
Hashes for blurhash_python-1.0.2-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 64698d1b56c8a0fabffda0ecc29a7e7af7d687d923f3150320c9e1ad81d2b3c9 |
|
MD5 | 0cf2749bbf69812243f591ecdda4db6c |
|
BLAKE2b-256 | f554d2d6e35b3a1368a5363c4ed5244b081ff90f9353df25efa1b8d3898da6dd |
Close
Hashes for blurhash_python-1.0.2-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 95379d782ed48da2b70fef25909e511c469ee3c3ee895e11e711de8e5731af88 |
|
MD5 | 515d73dc1ac245b694ef853869b9cf2b |
|
BLAKE2b-256 | c9ec713637e27815bd87beb5fc4866909a02c6c423fc25b6068a4b19520cc96c |
Close
Hashes for blurhash_python-1.0.2-cp37-cp37m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 37b22741ce279a3ebec74756407fc2d41171526b73f62e8b98291e904fb190a1 |
|
MD5 | da4c6e613d4fa97d1197eb9082651976 |
|
BLAKE2b-256 | 7bb6c6827d6f4b2195ba82daa628bd94d182265eb0b131be24475b085e3cd2a1 |
Close
Hashes for blurhash_python-1.0.2-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89398e82e3e68870669cdff29daa9674833da88cb2bf20d78bf52a434a4ae748 |
|
MD5 | ee97435d4c9e550c2b701e9a7cb16f35 |
|
BLAKE2b-256 | 402a85933af0bbf875f8d65c77ae1bb77d9ff6c08e8ecb5d67e03b1c39e3c817 |
Close
Hashes for blurhash_python-1.0.2-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b4de936525a261f4a88deed87aefca6625368e9d9e5b96d05f5325842e846c0c |
|
MD5 | 0612101c48789a7bbc3e05ebfb162fcb |
|
BLAKE2b-256 | 134f74e37bd38780b2f5a357b313fa61085752e7bb5af6c6367b4b44464dd47f |
Close
Hashes for blurhash_python-1.0.2-cp36-cp36m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a12deafaa00a945cd720bafa687863cdb311ec097fbc5aa636648a3597128f39 |
|
MD5 | 87dd92455737c1f7baf3b964b6950c41 |
|
BLAKE2b-256 | 69ed9fefc5718cbf2277c967ad703465cc5ff9ebeef5c9ba632ad4c856371498 |
Close
Hashes for blurhash_python-1.0.2-cp27-cp27mu-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea66265c0e41eda67012d52e3c75fe9774b657af3a99379104b7d66bbbbdcc2f |
|
MD5 | 4d894cddebf24b2c9b5b5b0cf5a4440c |
|
BLAKE2b-256 | b1d35bf5932faa0436955f17adae9796dc682d40793eed79af5deb8fec5afd68 |
Close
Hashes for blurhash_python-1.0.2-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a11f0e811a185c79e19f534b499ef3f77e80456d9bb3eece2aab0bfd9cc2fff |
|
MD5 | 50e6d74823cc88c3e2d164f97304adf5 |
|
BLAKE2b-256 | 66a8e5da029eb230267182d888ff254d0bf54108a05eeaea7ee65700532fb9a4 |
Close
Hashes for blurhash_python-1.0.2-cp27-cp27mu-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 920791ee8f9c8ad9736d74836f8db2cb346245be347e85c5fb701bda72a94bd5 |
|
MD5 | 8849011a67a0611707d0e21dcb2b2326 |
|
BLAKE2b-256 | 7e1d3c86e890572fe2603caffaf66cf10909f098170e1c360dbda2cbe5310f95 |
Close
Hashes for blurhash_python-1.0.2-cp27-cp27m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 275892ffa255b9229cb2c7baa81f1c6de4253ffb4495467b3cc0002334394a8d |
|
MD5 | 7ef46e022e175e7aa2313b3939386b7e |
|
BLAKE2b-256 | 63ddaad41e1c32827300f0f0b2e0db327ae63ac7895cb7184b0398f7e9a82b2d |
Close
Hashes for blurhash_python-1.0.2-cp27-cp27m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c802bf391655b66dfa1a42faf474149975417e929284dc104937e1518eb76333 |
|
MD5 | c6e4285a0cfc9da71c3fd845ee38bb40 |
|
BLAKE2b-256 | 7c56baf0618efbeffcadea9edefc06986ae101360ce840150fff1cfdbb47b3e2 |
Close
Hashes for blurhash_python-1.0.2-cp27-cp27m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3bc37dbb399e1bad02e3f779125b7b1924efe261efe5e3ce878f256aa906938b |
|
MD5 | 90f56d4ad504e6709570280161630a1e |
|
BLAKE2b-256 | a7a1dd373a039cc83f463a65b48a5d791e3617022de5ce6865e8c7baa1c39716 |