person holding white and blue plastic pack

For decades, the image compression war has been fought on a single front: file size. We've obsessed over squeezing every last kilobyte out of JPEGs and WebPs to save bandwidth. But there's a hidden bottleneck that often goes ignored—the CPU cost of actually unpacking that data. Enter Nibnib, a niche but fascinating new format that prioritizes decompression latency over raw compression ratios.

The Secret Sauce: Delta Palettes

At first glance, Nibnib looks like a classic palette-based image. However, it employs a clever twist to avoid the 'blocky' look typical of low-bit-depth images. Instead of storing absolute colors in its palette, Nibnib stores deltas. By storing the difference between colors, the format can represent soft gradients and subtle shading much more effectively than a standard palette, maintaining visual quality while keeping the data lean.

Cursor AI 50 percent off banner

Speed Through Simplicity

Where Nibnib truly shines is in its execution. Born from an experiment to enable DVI output on the RP2350 microcontroller, it is designed for environments where every clock cycle counts. The format achieves a constant 4 bits per pixel (bpp) by decoding two pixels simultaneously from a single byte of input. This deterministic, streamlined approach removes the complex computation typically required by modern codecs, making it a dream for real-time high-performance asset loading.

A Shift in Priorities

While critics on Hacker News point out that formats like BCx offer similar codebooking with better interpolation, Nibnib represents a broader shift toward 'instant-on' assets. In a world of high-refresh-rate displays and constrained embedded hardware, the time it takes to get a pixel onto the screen is becoming more valuable than the disk space it occupies.

Sources

Media