Raph Levien's nibnib decodes images two pixels at a time to hit extreme speed on an RP2350

Nibnib: Image compression with extreme decompression speed

Raph Levien's nibnib decodes images two pixels at a time to hit extreme speed on an RP2350

A 4bpp image format built for extreme decompression speed, born from an experiment in DVI output on the RP2350 microcontroller. Its palette stores deltas rather than absolute colors, so soft regions look far better than plain palette images. Decoding reads one byte per pixel pair, doubles the previous pixel, and adds a palette entry — roughly 6 cycles per pixel. Encoding is asymmetric and orders of magnitude slower, relying on Floyd-Steinberg error diffusion.

The nibnib format uses a palette at its core, but surpasses palette images in quality because the palette stores a delta rather than the absolute color, vastly improving soft regions.

More from this day

2026-11-01