← Back to context

Comment by grabshot_dev

2 days ago

If you go the image-rendering route for e-paper, Sharp (the Node.js libvips binding) is surprisingly good for this. You can do grayscale conversion, resize to the exact panel resolution, and apply Floyd-Steinberg dithering all in one pipeline with minimal memory overhead.

The trick with e-ink displays is that naive grayscale conversion looks terrible because you lose all mid-tone detail. Dithering the image down to 2-4 levels before sending it to the display makes a huge difference in readability, especially for things like weather icons and charts. ImageMagick can do it too but Sharp is about 4-5x faster for batch processing since it avoids spawning subprocesses.