[epaper_spi] Enhance color capabilities for spectra e6 with dithering #3467
Replies: 3 comments 1 reply
-
|
🏷️ I've automatically added the |
Beta Was this translation helpful? Give feedback.
-
|
you could probably do this youself using a good amount of code within the lambda. Not saying that's how it should be, it's way harder than it should be, but that should work |
Beta Was this translation helpful? Give feedback.
-
|
To fill backgrounds with a background color not supported by default, I am now applying a workaround that should have minimum size and hopefully memory effect on the application. Instead of setting a For example if I want a cyan background, I create a 2x2 bmp image with then in the yaml code, I load the image normally image:
- file: "<path_to_bmp>"
type: RGB565
id: bg_cyanand add it to the object - obj:
pad_all: 0
bg_opa: TRANSP
clip_corner: true
width: 100%
height: 70
widgets:
- image:
src: bg_cyan
width: 100%
height: 100%It's important to set This works quite well for me for the moment. Just in case anyone tries to achieve the same. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Component name
epaper_spi
Link to component documentation on our website
https://esphome.io/components/display/epaper_spi/
Describe the enhancement
Currently the implementation for mapping colors for the spectra e6 in https://github.com/esphome/esphome/blob/dev/esphome/components/epaper_spi/epaper_spi_spectra_e6.cpp limits the colors to the 6 built-in colors of the display.
By applying dithering techniques, this could be enhanced to display more colors, for example for LVGL widgets filling or for text colors.
In a simple form, limited to any combination of the 6 built-in colors, this could be managed by applying a checkerboard dithering between two built in colors, producing colors like cyan, magenta, orange, etc.
Example1: color magenta (
rgb(255,0,255))instead of returning
REDfor every pixel in a 3x3 area, return(R=RED, B=BLUE) which produces a purple effect for the viewer.
Example2: lighter red color (
rgb(255,130,130)) as a mix ofREDandWHITEpixelsNote: This does not require more sophisticated dithering algorithms like FloydSteinberg, as in this simple form only a static mapping is applied. Therefore it's less compute-intensive.
By combining only two built-in colors, theoretically 15 more colors could be displayed on the epaper which would then result in 21 colors instead of 6.
Use cases
Allows more colors to be displayed on the epaper screen when drawing objects.
Anything else?
Blog post which explains the desired result in more detail: https://myembeddedstuff.com/e-ink-spectra-6-color
This is a continuation of the discussion in esphome/esphome#12709
Beta Was this translation helpful? Give feedback.
All reactions