Key takeaways
- Use compact placeholders for loading appearance and real thumbnails for recognizable detail.
- ThumbHash can represent alpha and aspect ratio; keep exact layout dimensions separately.
- Include metadata transport and decoding costs when comparing hashes with tiny image files.
A blurred placeholder can make a photo feed feel smoother while images load. A file picker needs enough detail to tell one image from another. BlurHash and ThumbHash are useful for the first job; real thumbnails are usually better for the second. Compare them on your own images before choosing what to show.
Use a blur for loading and a thumbnail for recognition
A feed can look less abrupt if a blurred approximation appears before its image. That preview gives broad color and composition without promising readable text or identifiable objects. A file picker has another requirement: the user must distinguish similar documents or photographs. For that job, a real thumbnail is often more useful than a colorful blur, even if the blur is faster to obtain.
Choose a preview for each part of the interface. A loading state, search result, and review dialog may need different levels of detail. Keep the image’s informative description available to assistive technology while it loads; describing the blur’s colors is rarely useful to someone trying to understand the image.
Loading state
Show broad color and shape while a requested image arrives, then replace the placeholder with the real asset. Keep the surrounding dimensions stable throughout the transition.
Selection state
Use enough real detail to distinguish near-identical assets. An invoice number, face, or slide title may require a thumbnail or document preview rather than any hash-based blur.
Compare actual representations on the same source images
Use the official ThumbHash comparison to see the same sources rendered as ThumbHash, BlurHash, and a small image alternative. It also accepts your own images. Include a product photo, a flat logo, a transparent cutout, and a page containing text. Compare at the size the interface uses, not only in an enlarged desktop demonstration.
Look for the outcome that matters to the slot: broad color match, silhouette, transparent edges, or recognizable subject matter. A convincing result on a landscape photograph says little about a logo on transparency. These visual examples show algorithm behavior, not a ranking that applies to every image or a promise that the smallest representation will be fastest in your application.
BlurHash
Produces a low-detail color approximation with a configurable component count. Exact source dimensions must accompany the text hash, and transparent content needs a deliberate background treatment.
ThumbHash
Encodes broad brightness, color, transparency, and approximate aspect ratio. It chooses component counts automatically, whereas BlurHash exposes a component-count setting.
Thumbnail image
Keeps actual encoded image detail at a chosen size and quality. It can support recognition and reuse through image caching, at the cost of image bytes and possibly another request.
Account for the whole delivery path
A compact hash is attractive when it travels with data the page already needs. The client can decode it without a separate placeholder request. Include the string or base64 expansion, JSON overhead, decoder code, and drawing work in the comparison. A tiny image can also be cached or inlined, so counting only hash bytes and assuming every thumbnail needs a new round trip gives an incomplete result.
Measure the real image’s arrival as well. A smooth blur that delays the full image by blocking rendering or consuming the main thread has not improved the complete experience. Test on ordinary phones, with multiple list items, and under the expected cache conditions. Record both first appearance and the time at which useful image detail becomes available.
Reserve image space and check transparent edges
Reserve width and height or an aspect-ratio box before either representation loads. ThumbHash includes approximate aspect-ratio information, but exact asset dimensions remain the better source for layout. A placeholder and the final image should share the same crop and orientation policy; otherwise the transition can appear to jump even though the containing box never changes.
For a transparent logo, choose whether the temporary representation should remain transparent or be composited onto the interface background. ThumbHash supports alpha, while BlurHash needs an intentional preparation/background policy. Inspect on both light and dark surfaces. Incorrect alpha interpretation or a placeholder generated against a different background can create a flash or fringe when the full image arrives.
Generate metadata on the intended image rendition
Decide whether the placeholder should describe the original upload or the crop that will actually be displayed. If a gallery shows square derivatives, a placeholder for the uncropped wide original can have the wrong composition. Generate metadata from the chosen rendition and retain the relationship between its URL, dimensions, version, and placeholder. A later crop change needs a corresponding metadata refresh.
Transloadit documents optional BlurHash and ThumbHash extraction through output_meta on a producing Step: /upload/handle for originals or /image/resize for processed images. Setting it only on /transloadit/store does not request extraction. Successful ThumbHash extraction adds metadata usage equivalent to 20% of the image file’s bytes; no ThumbHash surcharge applies when disabled or no hash is produced. An S3 upload by itself does not run this extraction. Handle extraction limits and protect private previews.
Keep fallbacks independent of optional previews
Keep loading the image if its placeholder is missing or cannot be decoded. Reserve the space and show a fallback background while the request proceeds. If the image itself fails, show an error or retry option: leaving the blur in place can make people wait for an image that will never arrive.
For selecting or approving an asset, keep access to a real preview and the source context. Neither a BlurHash nor a ThumbHash verifies integrity, proves a duplicate, or establishes what the asset contains. Use checksums for exact-byte identity and separate similarity methods when finding near-duplicates. Keep these roles distinct in both field names and explanations so a “hash” is not accidentally reused for a security decision.
Technical details worth knowing
- BlurHash encodes a blurred approximation as a text string, with a configurable component count that affects detail and length.
- ThumbHash uses a compact binary representation with optional alpha and approximate aspect-ratio information; JSON commonly transports it as base64.
- BlurHash and ThumbHash cannot recover the original image or verify that two files contain the same bytes.
- A regular thumbnail is an independently encoded image and can retain text, edges, and recognizable details that blurred placeholders discard.
- Placeholder metadata can reveal broad image content, so it belongs under the same access policy as a private source image.
- Generating a placeholder and deciding when to request the full image are separate concerns; lazy loading does not generate a placeholder.
A practical approach
- 1
Choose representative photos, logos, transparent assets, and images containing text.
- 2
Compare actual decoded placeholders and small image derivatives at the interface’s display size.
- 3
Measure the complete metadata payload, decoder cost, and real-image loading behavior.
- 4
Reserve layout space and provide a fallback when a placeholder or full image cannot load.
When Transloadit is useful
Transloadit documents BlurHash and ThumbHash extraction in image output metadata, and image processing can create actual thumbnails. Request the metadata on the image-producing Step and consult its documented limits rather than assuming every file yields a placeholder.
Architecture boundary
Keep image descriptions and real previews available alongside the loading effect. If a placeholder is missing, show a fallback background while the image loads.
Frequently asked questions
Can I use a BlurHash to verify an image download?
No. BlurHash summarizes broad image appearance for display. Integrity verification needs a suitable cryptographic digest and a trusted expected value; a placeholder does not provide those properties.
Does ThumbHash eliminate the need to store image dimensions?
Its approximate aspect ratio can assist preview rendering, but exact dimensions remain useful for layout, responsive candidates, and crop validation. Keep the real rendition’s width and height in the asset record.
Should every thumbnail be replaced with a placeholder hash?
Choose by purpose. A loading state can use a blur, but an asset selector or review interface usually needs recognizable detail. Keep a real thumbnail or larger preview for decisions the blur cannot support.
What should happen when extraction returns no placeholder?
Treat the metadata as optional. Render a deliberate fallback, continue loading the valid image, and handle full-image failures separately. Do not hide the image just because a best-effort preview could not be generated.