HN
Today

Show HN: SplatHash – A lightweight alternative to BlurHash and ThumbHash

SplatHash is a new open-source project introduced on Hacker News that compresses images into a tiny 16-byte hash, generating a fast, blurry preview. It aims to be a more efficient alternative to existing solutions like BlurHash and ThumbHash, particularly excelling in decode speed and fixed output size. This 'Show HN' offering appeals directly to developers looking for highly optimized, cross-language image placeholder generation.

4
Score
0
Comments
#5
Highest Rank
8h
on Front Page
First Seen
Feb 28, 12:00 PM
Last Seen
Feb 28, 8:00 PM
Rank Over Time
8951418243028

The Lowdown

SplatHash is introduced as a novel and highly optimized image placeholder generator, developed to provide a lighter and faster alternative to popular tools like BlurHash and ThumbHash. It boasts a unique approach to image encoding, delivering a small, fixed-size hash that can quickly reconstruct a blurry preview.

  • Encodes any image into a fixed 16-byte hash, resulting in a 22-character base64url string.
  • Decodes a 32x32 blurry preview in an exceptionally fast 0.067 milliseconds.
  • Provides bit-for-bit identical hashes across Go, TypeScript, and Python implementations, ensuring cross-language consistency.
  • Benchmarks highlight its superior decode performance (0.067ms vs 0.50ms for ThumbHash and 6.55ms for BlurHash), making it ideal for client-side rendering.
  • Features include fixed output size, storability as a 128-bit integer, utilization of the Oklab perceptual color space, spatially localized Gaussian bases, and global weight optimization via Ridge Regression.
  • The underlying algorithm uses a background color combined with six optimized Gaussian blobs packed into 128 bits.

SplatHash positions itself as a compelling new option for developers needing ultra-fast and tiny image placeholders, particularly where decode speed and a consistent hash size are paramount.