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

Review
Android AuthorityOct 17

Android 17 QPR2 Beta 7.1: The Performance Relief You've Been Waiting

Android 17 QPR2 Beta 7.1: Finally Fixing the QPR1 Performance Woes Verdict: Android 17 QPR2 Beta 7.1 is a crucial and highly anticipated software update for Google Pixel users, specifically targeting and resolving the

AI's Confidence vs. Formal Methods' Rigor: Design Flaws & Verification
Programming
Stack Overflow BlogOct 16

AI's Confidence vs. Formal Methods' Rigor: Design Flaws & Verification

While AI accelerates code generation, formal methods remain critical for ensuring system correctness. Languages like TLA+ and tools like Quint enable developers to model and verify system designs before coding, catching subtle flaws. Quint makes formal methods more accessible with developer-friendly syntax and executability. This approach is vital for verifying AI-generated code through trace validation and model-based testing, ensuring reliability against real-world data.

Ephemeral PR Preview Environments on GKE: A Deep Dive
Programming
freeCodeCampOct 16

Ephemeral PR Preview Environments on GKE: A Deep Dive

Every development team eventually grapples with the limitations of shared staging environments. The familiar scenario: multiple features deployed simultaneously, database migrations clashing, and the phrase "it works on

Secure Internal API Access for AI Agents with MCP
Programming
freeCodeCampOct 16

Secure Internal API Access for AI Agents with MCP

AI agents accessing internal APIs directly pose significant risks, including identity loss, unrestricted queries, and security bypasses. The Model Context Protocol (MCP) offers a solution by defining explicit tools. A secure architecture involves an MCP server wrapping the API with strict input validation, coupled with a gateway that handles authentication, rate limiting, and audit logging, ensuring safe and accountable access.

regional: ‘What is fusion?’ Helion Energy harnesses the power of
Tech
GeekWireOct 14

regional: ‘What is fusion?’ Helion Energy harnesses the power of

Helion Energy, the Everett-based fusion startup, gained mainstream attention this week after being featured as a clue on the popular game show "Jeopardy!". The $800 clue, part of a "Y Combinator" category, highlighted Helion's mission to build the first fusion power plant, bringing the concept of clean energy to a wider audience. CEO David Kirtley celebrated the "surreal" moment as a sign that reliable clean power is becoming more accessible.

TGS 2026: These Forward-Looking Cosplays Are Already Living in the
Games
KotakuOct 15

TGS 2026: These Forward-Looking Cosplays Are Already Living in the

Tokyo Game Show 2026 showcased incredible cosplay, with many fans embodying characters from unreleased games like *Blast Blade* and *Mononoke No Kuni*. This gallery highlights the community's foresight, alongside debut *Palworld* cosplay and refreshed takes on classics. It’s a testament to the passion that brings gaming's future to life.

Back to Newsroom

Stay ahead of the curve

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