E-Ink Display ToolKit
2026.8.3
syo.su/eink© 2025-2026 DenSyo
e-mail: den@syo.su
Application is a pure JavaScript in one file and does not require an Internet connection for core functionality. Save page as "Webpage, HTML Only" for the local use and code editing capabilities
Implementation of web-server with API for uploading and drawing images on ESP32 as example of using application: github.com
Warning! Don't use on large images
Colors table ...:
Binary image ...- each pixel is represented by its own color, no image attributes and palette data, set manually file header and footer if need. Data can be expressed as: pixel - first pixel in high-order bits, byte - first pixel in low-order bits, word - first pixel in low-order bits of secon byte, dword - first pixel in low-order bits of fourth byte. Row length can be aligned to byte, two bytes, or four bytes: in which case first pixel of new row will be in next byte, word, or double word. With row alignment disabled, first pixel of new row will be in high-order bits of previous row byte. Enter header or footer file data in hexadecimal values separated by any delimiter or as one string.
Binary picture ...- binary image with header containing attributes and color palette. Bytes 1-4 - keyword and count of bits per color: PIN1, PIN2, PIN4, PIN8 is supported by application. Bytes 5-6 - image width, bytes 7-8 - image hieght. Byte 9 - flags: bits 1-2 - how data expressed: 0 - pixel, 1 - byte, 2 - word, 3 - dword; bits 3-4 - how row aligned: 0 - no, 1 - byte, 2 - word, 3 - dword; bit 5 - number format, affects width and height values of image, number of generated palette and user specified number, palette values in 2 bytes: 0 - little-endian, 1 - big-endian; bits 6-8 reserved. Byte 10 - how palette is represented in file. Byte 10 has value 0 - palette is contained in file header, in this case byte 12 contains index value of last color in file palette (count of colors in palette minus 1); byte 11 - flags: bit 1-6 - color depth: 0 - true color (3 bytes), 25 - high color (2 bytes); bit 7 - alignment of color values: 0 - no, 1 - dword; bit 8 - bit mask of used colors, mask starts at byte 13 and is always same size: 1 byte for 1 and 2 bits per color, 2 bytes for 4 bits per color, 32 bytes for 8 bits per color, data in mask is expressed similarly to image; palette starts after bit mask, if it is contained, or at byte 13; binary image begining after palette data. Byte 10 has value 1-2 - generated palette is used, in this case bytes 11-12 contain value for generation algorithm; binary image begining at byte 13. Byte 10 values 3-254 reserved. Byte 10 has value 255 - user defined, in this case bytes 11-12 contain an arbitrary value specified by user.
Mask and attributes ...-