AvifHash (Proof of Concept)

Leveraging the strengths of the AVIF image format to create compact and efficient image placeholders. Compare to BlurHash and ThumbHash.

Examples

Food Placeholder Food

ACylFHfy1OcIKKzQ/y8zCeDPPmA (27 bytes)

Girl Placeholder Girl

AyqNyZshUpVBs5k7EYXt5+Bu0eA (27 bytes)

Plate Placeholder Plate

A9jIV1NLTmQk3+AExLJKIA (22 bytes)

Coffee Placeholder Coffee

BZtmM6x1oJ7QrXCDnJui3edc/pI (27 bytes)

 

Details

Currently, this PoC relies on manually encoding 8x8 images to AVIF with avifenc, then opening them with a hex editor and cropping just the data that makes the actual image, deleting the ISOBMFF and OBU parts. This data is then converted with base64, alongside a 1-byte header that contains essential metadata information required to 're-hydrate' the image back to an AVIF for browser consumption.

So far, results have been very promising. AvifHash retains more detail than other implementations at a given size, and because it's based on AVIF, the door is open to support features like HDR, CICP colorimetry, and an alpha channel.