# BlurHash of an image

Compute the BlurHash string of an image: a short text placeholder that decodes to a blurred preview.

- Endpoint: `POST https://setget.net/v1/tools/image-blurhash` with JSON `{"input": {...}}` (add `"wait": 30` to hold the reply until the job finishes)
- MCP: `run_tool` with `slug` = `image-blurhash`
- Page: https://setget.net/tools/image-blurhash

## Files in, files out

This is a file tool. Its file inputs take file references, not file contents and not web addresses.

- Get a reference by uploading: `curl -T FILE https://setget.net/drop/` prints a line `ref  <id>/f1`. Or `POST https://setget.net/v1/drops` with `{"files":[{"name","size"}]}`, PUT the bytes to the returned `upload.url` with the listed headers, and use the file's `ref`. Over MCP use the `drop` tool. A file under about 700 KB can also be sent in place as a `data:<type>;base64,<content>` URI.
- Uploads are at most 100 MB per file, are readable by anyone with the link, and expire (one hour by default). Programs are refused.
- The tool runs as a job. The reply is `{"tool", "ms", "result", "files", "job"}`: `result` is JSON, and every result file comes back in `files` as `{"name", "size", "content_type", "kind", "url", "ref"}`. Download it from `url`, or pass `ref` as the input of another file tool.
- A job still running when the wait ends answers 202 with `job`. Follow it with `GET https://setget.net/v1/jobs/<id>?wait=30`, or stream progress from `GET https://setget.net/v1/jobs/<id>/events` (over MCP: the `job` tool). A person can watch it at `job.url`.

## Inputs

- `image` (required, file, a file reference such as `DROP_ID/f1`, accepts image): The image to encode.
- `components_x` (optional, integer, default `4`, range 1..9): Detail across the image, 1-9. More gives a longer string with more detail.
- `components_y` (optional, integer, default `3`, range 1..9): Detail down the image, 1-9.

## Example 1: Standard 4 x 3 BlurHash

Upload first. Each placeholder below stands for the reference of one upload: `DROP_ID/f1` = [sample.jpg](https://setget.net/static/samples/sample.jpg).

```json
{"input":{"image":"DROP_ID/f1"},"wait":30}
```

## Example 2: More detail

Upload first. Each placeholder below stands for the reference of one upload: `DROP_ID/f1` = [sample.png](https://setget.net/static/samples/sample.png).

```json
{"input":{"image":"DROP_ID/f1","components_x":6,"components_y":4},"wait":30}
```

**What is a BlurHash for?** Store the short string next to an image, and your app or page can show a soft blurred preview straight away while the real image loads. Decoders exist for most platforms.

**Which component counts should I use?** 4 x 3 suits landscape images and 3 x 4 portrait ones. More components give more detail but a longer string: its length is 4 + 2 x components_x x components_y.

**What happens to transparency?** Transparent areas are treated as white, because a BlurHash cannot hold transparency.
