v0.1.12universal placeholder generationMIT

Image in.
Placeholder out.

blurkit turns any image into a BlurHash or ThumbHash data URL across Node, Deno, browser, edge, Cloudflare, and WASM. One encode call, six runtimes, no ceremony.

pnpm add blurkit sharp
runtimes
06
algorithms
02
optional deps
01
config
00

Everything between file and first paint.

Decode, downscale, hash and render sit behind one call. The rest is tooling for builds, batches, and caches that survive a cold start.

Runtime entrypoints

Import the runtime you actually run on. No conditional shims, no guessing which decode path fired.

  • node
  • deno
  • browser
  • edge
  • cloudflare
  • wasm

Two algorithms

BlurHash for a tunable gradient, ThumbHash when the payload has to stay tiny. Same call, one flag.

  • blurhash
  • thumbhash

A finished result

Every encode returns a data URL, the raw hash, placeholder dimensions, and the source metadata behind it.

  • dataURL
  • hash
  • meta

Batch encoding

encodeMany() for one job with many images, encodeManySettled() when a single bad file must not sink the run.

  • encodeMany
  • settled

CLI and manifests

Single-image JSON from the terminal, or folder manifests wired straight into a build and a CMS import.

  • blurkit encode
  • manifest

Cache helpers

Memory and filesystem helpers for Node, worker cache support on Cloudflare. Encode once, reuse everywhere.

  • memory
  • filesystem
  • worker

The runtime matrix.

Each entrypoint picks its own decode path. Use the native one when the runtime has it, the wasm codecs when it does not.

Every entrypoint ships encode(), encodeMany(), and encodeManySettled().Compare runtimes in the docs

Test it here.

The demo runs the browser runtime on your machine. Drop an image, move the sliders, read the exact payload you would ship.

SourceUpload
Loading preset imageThe demo boots from the local sample.
PlaceholderPNG
Generating placeholderProcessing in the browser runtime.
Original
Pending
Output
Pending
Format
Pending

Outputs

// Waiting for a generated data URL.