What is ThumbHash?

ThumbHash is a compact binary representation of an image placeholder. It summarizes broad image structure and color, includes aspect-ratio information, and can represent transparency for display before the real image loads.

How ThumbHash works

ThumbHash stores a few values describing broad brightness, color, and, optionally, transparency patterns. A decoder uses them to draw a blurred preview. The algorithm chooses its component counts from the image’s aspect ratio and whether it has transparency; there is no component-count setting to adjust. BlurHash lets the caller choose those counts. ThumbHash also stores an approximate aspect ratio, but the full image’s dimensions are still needed for an exact layout.

Key facts

  1. Base64 is a transport encoding for the binary hash, not a separate placeholder algorithm. The client must use a compatible ThumbHash decoder.
  2. A ThumbHash cannot recover the original image or replace a detailed thumbnail. Its purpose is a brief, low-detail loading preview.
  3. A ThumbHash is not an integrity digest or proof of similarity. Protect the placeholder when the image itself is private.

When ThumbHash matters

Store ThumbHash bytes in an appropriate transport representation, such as base64 in JSON, and decode them into a temporary preview. Keep the full image’s dimensions and access policy with the asset record.

How Transloadit helps with ThumbHash

Transloadit extracts a ThumbHash when output_meta includes "thumbhash": true on the Step producing the image, such as /upload/handle for uploaded originals or /image/resize for processed outputs. Setting it only on /transloadit/store does not request extraction.

The base64-encoded result appears in meta.thumbhash with meta.has_alpha. It describes the displayed pixels after EXIF orientation is applied and uses the first frame of animated images. Images above 40 megapixels, unsupported formats, or failed bounded decoding produce no placeholder; an S3 upload by itself does not run this extraction. Successful extraction adds a metadata charge equivalent to 20% of the file’s bytes; no ThumbHash surcharge applies when no hash is produced.

Explore Transloadit’s image capabilities

Sources

Turn media knowledge into a working pipeline

Connect uploads, processing, AI, storage, and delivery through one declarative API — with the encoding stack, scaling, and format churn handled for you.

Try Transloadit for free