skillfed

blurhash-python

BlurHash encoder implementation for Python

blurhash-python v1.2.2 167.2K downloads/30d#10,474 on PyPI
Permissive license DORMANT released

What it is and what it does

blurhash-python is an encoder for the BlurHash algorithm, which converts images into short, compact text hashes that represent their visual content. These hashes are useful for generating placeholder images, progressive loading strategies, or perceptual image comparison without storing full image data. The package accepts images from file paths, file objects, or in-memory image objects, and lets you control the detail level via x_components and y_components parameters (each 1–9) to trade off hash length against visual fidelity.

The package depends on cffi for compiled bindings, Pillow for image manipulation, and six for Python 2/3 compatibility. It ships precompiled wheels for Linux on x86_64 and aarch64 across Python 3.8–3.12, reducing install friction on those platforms. However, maintenance is dormant—the last release was 933 days ago—so forward compatibility with future Python versions or dependency updates is not guaranteed.

Use it for:

  • Generate compact placeholder hashes for images in web applications to show during lazy loading or progressive image reveal.
  • Create perceptual fingerprints of images for deduplication or similarity detection without storing full image data.
  • Encode user-uploaded images into short strings for storage in databases or URLs when a visual preview hash is needed.
  • Build image preview systems that display a blurred approximation while the full image loads over slow connections.
  • Implement content-addressable image caching by hashing visual content rather than file metadata.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Encodes images into BlurHash strings, compact perceptual hashes that represent image content as short text suitable for placeholders or progressive loading.

Yes, if you need BlurHash encoding and can tolerate dormant maintenance. The package is marked Production/Stable, has no known vulnerabilities, and works reliably across modern Python versions on common platforms. Install friction is moderate due to compiled bindings, but prebuilt wheels are available. The main risk is that future Python or dependency updates may not be addressed promptly; verify decoding support and dependency requirements first.

Install

blurhash-python on PyPI

pip

pip install blurhash-python

uv

uv add blurhash-python

poetry

poetry add blurhash-python

Installing blurhash-python

Before you install

Medium install friction due to compiled cffi bindings across multiple Python versions and architectures. Dormant maintenance (933 days since last release) with no recent commits tracked, though marked Production/Stable and supporting Python 3.8–3.12.

License in practice

MIT license (permissive) imposes minimal restrictions; you may use, modify, and distribute freely with attribution.

Quickstart

pip install blurhash-python

import blurhash

hash = blurhash.encode('image.jpg', x_components=4, y_components=3)

x_components and y_components must each be between 1 and 9.

Verify before relying

  • Whether dormant status (933 days since release) poses a risk for future Python or dependency compatibility.
  • Performance characteristics and typical hash generation time for various image sizes.
  • Decoding capability—fact sheet only mentions encoding, unclear if decode is supported.
  • Full range of supported image formats and whether Pillow must be pre-installed.

Package facts

License not declared (permissive)
Python support not specified
Install friction medium — platform-specific wheel
Runtime dependencies 3 — cffi, Pillow, six
Maintenance dormant — 933 days since the last release
First released
Downloads 167,240/month — #10,474 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: blurhash_python-1.2.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl; blurhash_python-1.2.2-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_28_x86_64.whl; blurhash_python-1.2.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl; blurhash_python-1.2.2-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_28_x86_64.whl; blurhash_python-1.2.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl; blurhash_python-1.2.2-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_28_x86_64.whl; blurhash_python-1.2.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl; blurhash_python-1.2.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_28_x86_64.whl; blurhash_python-1.2.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl; blurhash_python-1.2.2-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_28_x86_64.whl

Development Status :: 5 - Production/StableLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

blurhash encoderimage placeholder hashperceptual image hashcompact image encodingblurhash python implementationimage to hash conversionprogressive image loading
image-hashingplaceholder-generationperceptual-encoding

More Graphics packages