
A lightweight NPM package for React that enables developers to add beautiful blurred image placeholders using visual hashing, improving UX and perceived performance.
useBlysh provides a lightweight, performant way to handle image loading by integrating beautiful blurred placeholders into your application.





useBlysh is a lightweight, high-performance image loading solution that brings visual hashing and beautiful blurred placeholders to web applications.
Images are typically the heaviest resources on modern websites. Loading them asynchronously often leads to jarring content layout shifts and abrupt "pop-ins," which degrade the user experience. useBlysh solves this problem by representing any image as a tiny, compact text string (a hash). This hash can be immediately decoded and rendered on the client as a beautiful, lightweight blurred canvas, acting as a placeholder while the full image loads in the background.
With dual-language implementations in TypeScript/React and Python, useBlysh allows developers to easily encode images on the backend or during build pipelines, and seamlessly render them on the frontend.
Here is a visual flow showing how useBlysh encodes an image into a hash and decodes it back into a beautiful blur effect:
32x32 pixels using high-quality Lanczos interpolation. This eliminates heavy high-frequency noise and focuses the visual signature on large color blocks.0-9, A-Z, a-z, and specific symbols) to yield a highly compact string (usually under 30 characters).ImageHashCanvas uses an IntersectionObserver with a rootMargin of 200px. Decoding is completely deferred until the element is close to the viewport.setTimeout(..., 0) block. This yields execution back to the browser's main thread, keeping layout operations and scroll physics (like Lenis) butter-smooth.32x32 canvas. By using native browser styling (image-rendering: pixelated combined with object-fit: inherit), the browser automatically scales the canvas with hardware acceleration.<ImageHash> component out of the box that abstracts the entire lifecycle (lazy loading, canvas rendering, load state, and cross-fade).py-useblysh) that mirrors the TypeScript library, allowing backend image processing that fits frontend React rendering.opacity 0.5s ease-in-out) between the placeholder and the final high-resolution image.32x32 grid before applying the DCT step ensured consistent, cross-platform hash matches.IntersectionObserver combined with setTimeout yielding solved performance bottlenecks, reducing main thread blockages to <1ms.32x32 canvas and styling it with width: 100%; height: 100% offloads the interpolation and blur rendering entirely to the GPU, improving render performance.useBlysh bridges the gap between raw web performance and polished design aesthetics. By reducing perceived load times and eliminating layout shifts, it offers a premium, modern experience for users, making image loading feel instantaneous and smooth.