News Froggy
newsfroggy
HomeTechReviewProgrammingGamesHow ToAboutContacts
newsfroggy

Your daily source for the latest technology news, startup insights, and innovation trends.

More

  • About Us
  • Contact
  • Privacy Policy
  • Terms of Service

Categories

  • Tech
  • Review
  • Programming
  • Games
  • How To

© 2026 News Froggy. All rights reserved.

TwitterFacebook
Programming

Show HN: SplatHash – 16-Byte Blurry Image Previews for Blazing Fast UI

SplatHash offers a novel approach to image placeholders, encoding any image into a fixed 16-byte string (22-char base64url). It stands out with significantly faster decoding and lower memory allocations compared to alternatives like BlurHash and ThumbHash, making it ideal for performance-critical UIs where client-side rendering speed is paramount. It uses Oklab color space and Gaussian blobs packed into 128 bits.

PublishedFebruary 28, 2026
Reading Time6 min
Show HN: SplatHash – 16-Byte Blurry Image Previews for Blazing Fast UI

Show HN: SplatHash – 16-Byte Blurry Image Previews for Blazing Fast UI

As developers, we constantly strive for optimal user experiences, and few things impact perceived performance as much as image loading. While lazy loading and optimized image formats help, users often still see blank spaces or spinners before the full image appears. This is where blurry image placeholders come in, providing an immediate visual cue that content is on its way, reducing perceived latency.

Existing solutions like BlurHash and ThumbHash have proven invaluable, encoding an image into a compact string that can be quickly decoded to render a low-resolution preview. However, a new contender, SplatHash, has emerged, promising an even more lightweight and performance-optimized approach. It compresses any image into a fixed 16 bytes, reconstructing a 32x32 blurry preview, and aims to deliver superior decode performance.

The Drive for Compact, Rapid Placeholders

The fundamental challenge with image placeholders is finding the sweet spot between visual quality, hash size, and the performance of both encoding (generating the hash) and decoding (rendering the preview). For client-side rendering, particularly in lists or grids of images, decoding speed and minimal memory allocations are paramount. Every millisecond and byte saved on decode contributes directly to a smoother, faster user interface.

SplatHash addresses this by making specific design choices focused on an extremely compact representation and rapid client-side rendering. Unlike some alternatives, it commits to a fixed output size, simplifying storage and transmission considerations.

Unpacking SplatHash: Fixed Size, Blazing Decode

SplatHash's core value proposition is its ability to encode any image into exactly 16 bytes, which translates to a 22-character base64url string. This fixed size is a significant advantage for predictable data transfer and storage, especially when dealing with large numbers of images. Upon decoding, it produces a 32x32 pixel blurry preview, striking a balance between detail and speed.

Its standout feature is its decode performance. Benchmarks show SplatHash decoding in 0.067 ms with just 7 memory allocations. This is significantly faster than ThumbHash's 0.50 ms (1,168 allocs) and BlurHash's 6.55 ms (5 allocs). While SplatHash's encoding time (3.53 ms) is slower than ThumbHash (0.86 ms), it’s still orders of magnitude faster than BlurHash (445 ms). The rationale here is clear: encoding happens once during upload, but decoding happens on every page load for every user, making decode optimization critical.

Under the Hood: A Glimpse into the Algorithm

SplatHash achieves its efficiency through a sophisticated algorithm detailed in its ALGORITHM.md document. At a high level, it represents an image using a combination of a background color and six spatially localized Gaussian blobs. The process involves:

  1. Perceptual Color Space: Operations are performed in the Oklab color space, which is perceptually uniform. This means that numerical differences in Oklab values correspond more accurately to human perception of color differences, leading to more visually pleasing and accurate blurry previews.
  2. Matching Pursuit for Placement: Gaussian blobs are strategically placed within the image using a matching pursuit algorithm to capture prominent features.
  3. Ridge Regression for Color Optimization: The colors of these blobs and the background are optimized using Ridge Regression, ensuring the best possible color representation within the limited data.
  4. 128-bit Packing: All the derived coefficients—background color and the parameters for the six Gaussian blobs—are meticulously packed into a mere 128 bits (16 bytes) for the final hash.

This combination of techniques allows SplatHash to generate a visually reasonable preview from a remarkably small footprint.

Integrating SplatHash into Your Stack

SplatHash provides implementations across popular languages, with Go serving as the reference implementation. All other language versions are verified to produce bit-for-bit identical hashes, ensuring consistency across your ecosystem. You can easily integrate it into your projects:

For Go: shell go get github.com/junevm/splathash/src/go

For TypeScript / JavaScript: shell npm install splathash-ts

For Python: shell pip install splathash-py

Once installed, the general workflow involves encoding an image (e.g., during upload or asset processing) to get the 16-byte hash, storing this hash alongside your image metadata, and then decoding it on the client-side to render the blurry preview while the full image loads.

Key Differentiators and Tradeoffs

SplatHash introduces several distinct features:

  • Fixed Output Size: Always 16 bytes (22 base64url characters), simplifying data management.
  • 128-bit Integer Storage: The hash can be stored directly as a 128-bit integer, offering efficient database storage and manipulation.
  • Perceptual Color Space (Oklab): Ensures more accurate and natural color representation in the preview.
  • Spatially Localized Basis (Gaussians): Helps in capturing more localized image details within the compact hash.
  • Global Weight Optimization (Ridge): Contributes to overall color accuracy.
  • Alpha Channel Support: Handles images with transparency.
  • Bit-Exact Cross-Language Parity: Guarantees consistent results across Go, TypeScript, and Python.

The primary tradeoff for SplatHash's fixed 16-byte size and superior decode performance is the lack of configurable quality versus size. Unlike BlurHash, you cannot adjust parameters to generate a larger hash for a higher-fidelity preview; it's a fixed-quality, fixed-size solution. This design decision prioritizes predictability and speed for the most common use case.

SplatHash presents a compelling option for developers seeking a highly performant, ultra-compact image placeholder solution. Its focus on decode speed, fixed size, and advanced algorithmic techniques makes it an excellent candidate for enhancing perceived performance and user experience in demanding applications.

Technical FAQ

Q: Why is decode performance prioritized over encode performance in SplatHash?

A: Decode operations happen frequently on the client-side for every user and every image display, directly impacting perceived load times. Encoding, on the other hand, typically occurs once during image upload on a server, making its performance less critical for user experience.

Q: How does SplatHash achieve its fixed 16-byte output size?

A: SplatHash achieves its fixed 16-byte size by carefully packing the coefficients for its background color and six Gaussian blobs into 128 bits. This compact representation is a fundamental design choice, contrasting with solutions that use variable-length hashes for adjustable quality.

Q: What is the significance of using the Oklab color space and Gaussian basis in SplatHash?

A: Oklab is a perceptually uniform color space, meaning color differences in Oklab correlate more closely to how humans perceive color differences, leading to more visually accurate blurry representations. The spatially localized Gaussian basis functions allow for capturing prominent image features efficiently within the fixed 16-byte constraint, contributing to better visual quality from minimal data.

#image-processing#performance#web-development#golang#typescript

Related articles

PlayStation Showcase Chat Swamped by Demands for Destiny 3
Games
KotakuJun 3

PlayStation Showcase Chat Swamped by Demands for Destiny 3

PlayStation's recent State of Play showcase was largely overshadowed by an impassioned fan campaign in the Twitch chat, demanding 'Destiny 3'. Amidst reveals for new PS5 games, the chat was relentlessly spammed with #WeWantDestiny3, fueled by the unexpected sunsetting of Destiny 2 and the reported absence of a direct sequel. This digital protest reflects widespread community frustration, amplified by a popular streamer and a petition with over 330,000 signatures.

Programming
Hacker NewsJun 2

Great Question (YC W21) Seeks Applied AI Interns: A Deep Dive

As fellow developers, we’re constantly scanning the landscape for companies pushing the boundaries, especially in the rapidly evolving AI space. Great Question, a Y Combinator W21 alumnus, has caught our eye with an

Navigating the Global AI Arena: Beyond Silicon Valley's Borders
Programming
Stack Overflow BlogJun 2

Navigating the Global AI Arena: Beyond Silicon Valley's Borders

The international AI landscape presents unique challenges and opportunities, requiring developers to think beyond traditional tech hubs. Key aspects include adapting AI models to local languages and cultures, navigating the complex global supply chain for critical hardware like semiconductors, and understanding how venture capital assesses these international ventures. Success hinges on deep local market understanding, robust technical solutions for localization, and resilience against logistical hurdles.

Programming
Hacker NewsJun 2

Engineering a Solution: Debugging Global Mosquito-Borne Diseases

As developers, we're constantly tasked with solving complex problems, whether it's optimizing a database query or architecting a distributed system. But what if the 'bug' we're trying to fix is biological, with global

Self-Host S3-Compatible Object Storage with MinIO on Staging
Programming
freeCodeCampJun 2

Self-Host S3-Compatible Object Storage with MinIO on Staging

This guide demonstrates how to self-host an S3-compatible object store using MinIO on your staging server. By leveraging Docker Compose and Traefik for HTTPS, you can significantly reduce cloud storage costs while maintaining a production-like environment for development and testing. It covers setup, application configuration, and secure file interactions.

How to Watch 5 Heart-Pounding Movies on Prime Video This Week
How To
How-To GeekJun 1

How to Watch 5 Heart-Pounding Movies on Prime Video This Week

Ready for a week of intense cinematic thrills? This guide will show you exactly how to find and stream five heart-pounding movies available on Amazon Prime Video from June 1-7. Get ready for a mix of crime sagas,

Back to Newsroom

Stay ahead of the curve

Get the latest technology insights delivered to your inbox every morning.