Convert an image into a format suitable for use with my Arduino library for the Pervasive Displays Spectra 4.2" E2417ES053 EPD. Images are not uploaded to my server; all conversions are done in the browser.
If your image only contains solid red, black, and white, use the 'Posterize' option.
Adjust the red and white threshold values to change how the three-colour palette is applied to the image.
A 400px x 300px image can be read directly into spectra.buffer. For any other size of image, you will need to use spectra.draw_rect or a custom routine that sets the contents of spectra.buffer.
The length of the binary file or array will be (2 * ((width * height) / 8)). That's one byte for every eight pixels of the 'black frame' followed by one byte for every eight pixels of the 'red frame'.