The Better than PNG Image Format for
Fast, Lossless Compression

BNG is fast. And small! On our 1,797-image benchmark, it produces files 13.13% smaller than libpng’s output, with 29.61× faster encoding and 1.39× faster decoding overall. All codecs compress matching 8-bit premultiplied pixel data.

BNG is simple. The reference encoder and decoder together are 469 lines of C. The file format specification is one plain text file.

The BNG samples use premultiplied alpha; the paired PNGs are unchanged straight-alpha originals. BNG compression preserves the stored pixels exactly. Converting straight alpha to premultiplied alpha can lose colour precision and discards hidden RGB at zero alpha.

The BNG logo (black version), the specification and the implementations are free to use. All of the code linked here is available under the Unlicense.