blurhash
Pure-Python implementation of the blurhash algorithm.
What it is and what it does
Blurhash is a pure-Python implementation of the blurhash algorithm that converts images into short text strings representing blurred versions of those images. The library exports encode and decode functions to transform between image arrays and blurhash strings, plus helper functions for color space conversion between sRGB and linear color. It has no runtime dependencies, making it lightweight to add to any project.
The typical use case is generating placeholder images during page load: you encode an image once and store the small hash string alongside your image metadata, then decode it to quickly display a blurred preview while the full image loads or before showing it behind a content warning. The decode function accepts a punch parameter to adjust contrast and can decode to any specified width and height.
Use it for:
- Generate blurred placeholder images for web pages while full-resolution images are loading.
- Store compact image previews in metadata or databases without storing full image files.
- Create content-warning blur overlays by decoding blurhash strings to small placeholder images.
- Embed blurhash strings in JSON responses to provide instant visual feedback before image delivery.
- Resize and blur images efficiently by encoding once and decoding to different dimensions.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Encodes images into compact blurhash text strings and decodes them back into blurred placeholder images.
Yes. The package is stable (Production/Stable status), has zero known vulnerabilities, installs with no dependencies, and solves a specific problem well for image-heavy applications. The aging maintenance status is not a blocker—the library is mature and the repository remains active. Install it if you need image placeholders or compact image representations.
Install
blurhash on PyPI
pip
pip install blurhashuv
uv add blurhashpoetry
poetry add blurhashInstalling blurhash
Before you install
Installs with no runtime dependencies and low friction. Last release was 362 days ago; the repository is active and not archived, though maintenance status is aging.
License in practice
MIT license (permissive) — you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
Quickstart
pip install blurhash
import blurhash
# Encode and decode blurhash strings
hash_string = blurhash.encode(image_array)
img_array = blurhash.decode(hash_string, 128, 128)
Requires a 3-dimensional array with y, x, and RGB components; encoding and decoding require external libraries like PIL and numpy to prepare image data.
Verify before relying
- Whether the aging maintenance status indicates future support concerns or is simply a stable, mature library.
- Performance characteristics when encoding or decoding very large images or many images in sequence.
- Python version compatibility beyond the classifiers indicating support for Python 2 and 3.
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | aging — 362 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 225,565/month — #9,219 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: blurhash-1.1.5-py2.py3-none-any.whl
Keywords: blurhash, graphics, web_development
Tags
More Graphics packages
Pillow adds image processing capabilities to…
permissive · top 100 on PyPI
fonttoolsfonttools manipulates font files in multiple…
permissive · top 1,000 on PyPI
matplotlib-inlineEnables matplotlib figures to display inline…
permissive · top 1,000 on PyPI
pymupdfPyMuPDF extracts, renders, converts, and…
agpl · top 1,000 on PyPI
pypdfium2pypdfium2 is a Python binding to PDFium that…
permissive · top 1,000 on PyPI
altairAltair is a declarative Python library for…
permissive · top 1,000 on PyPI
blurhash-pythonEncodes images into BlurHash strings, compact…
permissive · top 15,000 on PyPI
bitmapBitMap provides a compact bit array class for…
unclear · top 15,000 on PyPI
sqidsSqids encodes numbers into short, unique,…
permissive · top 15,000 on PyPI
qoiA Python wrapper for the QOI (Quite OK Image)…
permissive · top 15,000 on PyPI
hashidsGenerates short, unique, non-sequential hashes…
permissive · top 5,000 on PyPI
base36Converts integers to and from base36…
permissive · top 15,000 on PyPI
pyoxipngpyoxipng reduces PNG file sizes through…
permissive · top 15,000 on PyPI
bech32mEncodes and decodes Bech32 and Bech32m strings,…
permissive · top 15,000 on PyPI
pylzsspylzss decodes and encodes data compressed with…
copyleft · top 15,000 on PyPI
pyzbarDecodes one-dimensional barcodes and QR codes…
permissive · top 5,000 on PyPI