ThumbHash API

Generate a ThumbHash from any image URL. Returns the hash and a base64 placeholder image.

Try the API

Enter an image URL to generate a ThumbHash.

API Documentation

Usage

GET /api/thumbhash?url=<encoded_image_url>

Generate Example

curl 'https://thumbhash-api.pages.dev/api/thumbhash?url=https://upload.wikimedia.org/wikipedia/commons/thumb/4/47/PNG_transparency_demonstration_1.png/280px-PNG_transparency_demonstration_1.png'

Response

{
  "hash": "1QcSHFJ4hX+Jh4CZiYqHiol3iIqHiYmIh4CZiYuHj4A",
  "width": 100,
  "height": 56,
  "placeholder": "data:image/png;base64,..."
}

Supported Formats

PNG and JPEG. WebP, GIF, and SVG are not supported.