How BlurHash Works

A compact representation of a placeholder image stored in 20–30 printable ASCII characters.

Step 1

Downscale & DCT Analysis

The source image is pre-scaled to ≤128px for sub-millisecond CPU efficiency. A 2D Discrete Cosine Transform separates luminance/chrominance into 1 DC (average) and AC (spatial gradient) components.

Step 2

Base83 Non-Linear Quantization

AC factors are scaled, non-linearly quantized, and packed into Base83 characters safe for HTML, JSON, and URLs. String length is strictly deterministic: 4 + 2 × X × Y characters.

Step 3

Bilinear Canvas Expansion

The browser client decodes the string into a micro canvas (32×22px). The browser’s native bilinear texture filtering naturally interpolates the low-frequency gradients at zero memory cost.

Global Decode Parameter

1.0

Scales AC coefficient magnitude during decoding. Smaller values (<1.0) yield smoother, flatter tones; higher values (>1.0) intensify contrast and color variance across all placeholders.

0.5 (Soft) 1.0 (Standard) 2.0 (High Contrast)

Encode Playground

Drop or select any local image to execute 100% in-browser DCT encoding via CDN blurhash@2.0.5. Images downscale to max 128px before encoding per performance guidelines.

Drop an image here or click to browse Processes PNG, JPG, WebP locally in browser
Formula: 4 + 2 × 4 × 3 = 28 characters
Generated BlurHash—
...
Source (Max 128px)—
Decoded Placeholder32×22

Verified Landscape Gallery (8 Photographs)

Decoded from compact strings into 32×22 canvases. Real photos lazy-load via IntersectionObserver and smoothly fade in.