ForHosting KIT · Images

Generate a BlurHash

Before a photo finishes downloading, most apps show nothing, or worse, a flash of white. This endpoint generates a tiny encoded string that renders as a soft, blurred preview of the actual image, so the layout feels alive from the first frame instead of empty.

● StableFree · in your browser
Use it from WebAPIEmailApp soonTelegram soon

Runs in your browser. Free, unlimited — your data never leaves this page.

The blank-space problem

Photo-heavy feeds, galleries and marketplaces all face the same rendering problem: images are the heaviest asset on the page, and until they arrive, something has to occupy their space. A gray box or a spinner works, but it tells the user nothing about what's coming and makes the layout feel unfinished. A blurred approximation of the actual photo, by contrast, gives an immediate sense of color and composition, and the shift from blur to sharp photo reads as a natural reveal rather than a layout jump.

What the string actually encodes

Send an image to POST /image/blurhash and the task returns a short encoded string, typically well under a hundred characters, that captures the image's rough shape and color distribution. That string can be embedded directly in your API response or database record — no extra image file to store or fetch — and decoded client-side into a blurred canvas or CSS background in a few lines of widely available client code.

Where the technique comes from

The approach behind BlurHash-style encoding builds on a much older idea in image compression: represent an image as a sum of smooth basis functions rather than individual pixels, keeping only the first few terms to describe its overall look. That's conceptually related to how JPEG itself achieves compression, just taken to an extreme where you keep only enough information to describe the general shape and palette, discarding everything that would let you reconstruct fine detail — which is exactly the point for a placeholder.

How the result comes back

Every task on this API is asynchronous: submitting an image returns a task_id immediately, and the encoded string arrives through a signed webhook or a signed link valid for 24 hours. Because the output is just a short string rather than a file, it's cheap to store permanently alongside the original image record and reused on every render without recomputation.

Fitting it into a real pipeline

The natural place to call this is once, at upload time, storing the resulting string next to the image URL in your database so every future page load already has it available before the real photo is even requested. At $0.002 per request with failed attempts never billed, generating a placeholder for every image in a catalog costs a fraction of what the bandwidth savings and perceived speed improvement are worth.

Photo feeds and social apps

Show a blurred preview the instant a feed renders, then swap in the full photo as it loads, avoiding blank tiles while scrolling.

E-commerce product galleries

Generate a placeholder for every product image at upload time so gallery pages never show empty boxes during the first paint.

Image-heavy marketplaces

Store a blur string with every listing photo to keep search results feeling instant even on slow mobile connections.

Native and hybrid mobile apps

Decode the compact string locally to render a smooth placeholder before any network request for the actual image completes.

How does BlurHash differ from a low-res thumbnail?

BlurHash returns a short text string, not an image file, so there's nothing extra to store or download; a thumbnail is still a separate file that needs its own request.

Is the BlurHash API free to use?

The tool above runs free in your browser. The API is paid — each call draws from your prepaid ForHosting KIT balance: top up from $10.00 (it never expires), pay each request's published price, and a call with no balance returns HTTP 402. No subscription, no tokens, and a failed task is never charged.

How large is the resulting string?

Typically well under a hundred characters, small enough to store directly as a database field alongside the image record.

Do I need a special library to render it?

You decode the string client-side using widely available open decoders for web, iOS and Android; the API's job is just to generate the encoded string.

Can I generate placeholders for an entire image library in bulk?

Yes, submit one request per image; each is queued and billed independently, so processing a whole library is just repeated calls, no special batch mode needed.

How do I receive the generated string?

Via a signed webhook, recommended for automated pipelines, or a signed link valid for 24 hours.

What image formats can I submit?

Standard raster formats such as JPEG and PNG are supported for generating the placeholder encoding.

Should I regenerate the string if I resize the image?

No, the encoded string captures the overall shape and color of the image and stays valid regardless of the display size you render it at.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/image/blurhash

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, and soon from our app, email and Telegram.

curl -X POST https://api.kit.forhosting.com/image/blurhash \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"image":"https://ejemplo.com/imagen.jpg"}'
{
  "image": "https://ejemplo.com/imagen.jpg"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "image.blurhash",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

max_mb15
max_megapixels12
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Read the full KIT documentation →