explaingit

woltapp/blurhash

16,980CAudience · developerComplexity · 2/5Setup · easy

TLDR

BlurHash converts images into compact 20-30 character strings that decode into blurry color-correct placeholders, letting apps show something pretty while photos load instead of empty boxes, with no extra thumbnail data sent over the network.

Mindmap

mindmap
  root((blurhash))
    What it does
      Image to short string
      Blurry placeholder
      No thumbnail needed
    Tech stack
      C Swift Kotlin
      TypeScript Python
      Go Rust WebAssembly
    Use cases
      App image lists
      Web photo galleries
      Loading screens
    Audience
      Mobile developers
      Web developers
      Backend engineers
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Add blurry image placeholders to a mobile or web app without sending extra thumbnail data over the network

USE CASE 2

Encode images on your backend into short strings and store them alongside image records in your database

USE CASE 3

Decode BlurHash strings on the frontend to show blurry previews while the real photo finishes loading

USE CASE 4

Port the short under-200-line algorithm to a new language using the reference implementation

Tech stack

CSwiftKotlinTypeScriptPythonGoRustWebAssembly

Getting it running

Difficulty · easy Time to first run · 30min

Encode at the backend when storing images, decode at small sizes (20-32px wide) and let the UI scale up for best performance.

License type not specified in the explanation.

In plain English

BlurHash solves a small but visible problem in apps and websites: when a screen is full of images that haven't finished downloading yet, you stare at empty boxes. BlurHash gives you something pretty to show in their place, a blurry, color-correct preview of each image, without having to send any actual thumbnail data over the network. The trick is that BlurHash turns an image into a very short string, only 20 to 30 characters long. You compute that string on the backend once, when you store the image, and save it next to the image record. When your app or website fetches the image's metadata, it gets back the URL plus this little string. The client code decodes the string back into a small blurry image and shows it as a placeholder while the real image is loading. Because the string is so short, it fits comfortably inside the same JSON or database field you would already be using. The full technical description is in an Algorithm.md document the README points to, the algorithm itself is short, under two hundred lines of code, which is why it has been ported to many languages. The repository contains official encoder and decoder implementations in C, Swift, Kotlin, TypeScript, and Python, plus a long list of community ports including Go, PHP, Java, Rust with WebAssembly, Ruby, Dart.NET, Elixir, Haskell, React Native, Kotlin Multiplatform and more, so there is almost certainly a usable version for whatever stack you are on. For best performance, you scale your image down before encoding and decode at very small sizes (around 20-32 pixels wide) and let the UI scale them up. Wolt (the company behind it), Mastodon, Signal, and Jellyfin are all listed as users.

Copy-paste prompts

Prompt 1
Show me how to encode an image to a BlurHash string in Python and decode it back to a blurry preview image using the woltapp/blurhash library
Prompt 2
Write a TypeScript function that takes a BlurHash string and renders it as a blurry placeholder in a React component while the real image URL loads
Prompt 3
How do I integrate BlurHash into my Swift iOS app to show color-correct blurry previews while images download from a server?
Prompt 4
Give me a backend endpoint in Python that accepts an uploaded image, generates a BlurHash string, and stores it alongside the image record
Open on GitHub → Explain another repo

← woltapp on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.