← All tools

Blur placeholder

Tiny previews that show while images load.
Try
—Loading sample…
4px—
Base64 format
Exact colours. Works everywhere.
Fill transparent areasThis image has no transparency.
Adjust
1.00×
1.20×
0°
0
BlurHash detailMore components = more detail, longer hash
43
Base64 · 0 BOriginal · —
 
Base64 image—
● CanvasBase64 · ThumbHash · BlurHash · CSS · SVG · coloursame output as the npm packagesProcessed on this device

Which one should I use?

Pick by where the image comes from.

  • next/imageRemote images in Next.jsNext.js makes blurDataURL for you only for static imports. For images from a CMS or a CDN, paste the Base64 here.
  • databaseStore it with the recordThumbHash or BlurHash fit in a short text column next to width and height. Decode on the client.
  • no-jsStatic sites and emailsCSS gradients or inline SVG paint with the HTML, before any script runs.
  • buildA whole folder at onceBatch mode gives you one JSON file keyed by filename, ready to import at build time.

Questions

The short answers.

Is my image uploaded?

No. The image is drawn onto a canvas in this tab and every format is worked out there, so there's no file size limit and nothing to wait for.

What size should the placeholder be?

4 pixels wide (the default) keeps a photo's data URL around 160 characters. 8 pixels looks a little closer to the photo for roughly 280. Past 16 it mostly adds bytes to every page that shows the image, since it is blurred anyway.

BlurHash or ThumbHash?

ThumbHash keeps more detail, the aspect ratio and transparency in about the same number of characters. BlurHash has more ready-made libraries. Both need a small decoder on the page.

Why bump the saturation?

Blurring averages colours together and makes them look grey. A little extra saturation (1.2×) keeps the placeholder close to how the photo feels.

Is it the same output as the npm packages?

For the hashes, yes: ThumbHash and BlurHash are worked out by exact ports of the thumbhash and blurhash packages, so the same pixels give the same string. The adjustments mean the same as sharp's modulate(). The Base64 image is encoded in your browser, so its bytes can differ from what sharp would write, but the pixels are the ones shown.

See all →