eInk Radiator - #1: Display
I describe the display component of the eInk Radiator project.
The heart of this project is the eInk screen, a red, black, and white screen from Pimoroni called an InkyWHAT. It's extemely simple to use, because it connects to a Raspberry Pi through it's GPIO header. Pimoroni has published a Python driver in GitHub and PyPI, which abstracts away all of the bit bashing to get the hardware to work and just takes a PIL-style image object.
In the spirit of the modularized nature of the eInk Radiator project, the display module is a simple CLI. It takes an image as input, quantizes it down to the supported color palette, then displays the image on the hardware screen.
The quantization is the important piece, since the screens only support a limited color palette, the image needs to be reduced to only the supported colors. When done well, the resulting image can look very close to original. The CLI utilizes Pillow's Image Quantize function, which supports Floyd-Steinberg dithering. I'm always impressed at how good the resulting images look.
The result is an image that is properly paletted to the display. Here is the cardinal picture above displayed on the white, black, and red Inky wHAT. The simulation of the orange beak still blows my mind!
The source code is available on GitHub.