BlurHash creates a hash representation of an image, allowing previewing as it loads with minimal bandwidth usage, typically resulting in a 20-30 character long hash.
BlurHash is an open-source algorithm developed by Dag Ågren that generates compact representations of images that allow creating blurry placeholder previews. It works by capturing the basic colors and outlines of an image in a shorthand format. TheBlurHash for an image is typically around 20-30 characters long.
When the blurhash string is decoded, it renders a gradient blob that resembles the original image colors and shapes. This provides a preview of the image before it has fully loaded, which improves perceived performance. The small size of blurhashes also makes them suitable for use in thumbnail summaries and previews in listings.
BlurHash strikingly balances precision and size. At just 150-500 bytes, a blurhash can encode enough information to render a fuzzy preview image. The algorithm is flexible - longer hashes allow more complex and higher-fidelity blur effects. Blurhashes give developers control over this tradeoff between size and quality.
By providing lightweight image placeholders, BlurHash helps avoid layout reflows in web pages and applications as images load. It can also simplify handling of not-yet-loaded images across long lists and grids. The compact hashes are easy to generate server-side and integrate client-side to handle preview rendering efficiently.
Here are some alternatives to BlurHash:
Suggest an alternative ❐