Source code is here: https://github.com/samhocevar/p8z.

P8Z compression for images and data

Select a file to upload.

Ordered Dithering High Color

The p8u utility function:

Copy-paste this somewhere in your code. You only need one p8u() in your program.