Skip to content

CLI

Single Image

Generate one BlurResult JSON object from a local path or remote URL.

Use this flow when one asset must be encoded and consumed immediately.

Terminal window
npx blurkit encode ./public/hero.jpg --pretty

Alternative remote input example:

Terminal window
npx blurkit encode https://example.com/image.jpg --algorithm thumbhash --format jpeg --pretty

Wasm backend example:

Terminal window
npx blurkit encode ./public/hero.jpg --backend wasm --pretty
  • Without --out, JSON is written to stdout.
  • With --out, JSON is written to the given file path.
  • Backend defaults to sharp; use --backend wasm for wasm decode path.
  • --backend wasm requires blurkit-wasm-codecs installed.
  • Remote URL mode can fail on network errors.
  • Single-image mode does not create a manifest envelope.