Skip to main content

BlurHash encoder implementation for Python

Project description


This is an encoder for the BlurHash algorithm. To find out more about BlurHash, see


Install blurhash with pip

$ pip install blurhash-python

or pipenv

$ pipenv install blurhash-python


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.


Install development requirements and package in editable mode

$ pipenv install --dev


Run test suite with pytest in virtual environment

$ pytest

Use tox to run test suite against all supported python versions

$ tox

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

blurhash-python-1.1.3.tar.gz (177.5 kB view hashes)

Uploaded source

Built Distributions

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page