eleveyuan / Portal-Calendar-py

A Portal themed e-ink calendar based on the ESP32 platform-python version
MIT License
4 stars 0 forks source link

how to display picture with red and black colors in waveshare epaper #2

Closed eleveyuan closed 1 year ago

eleveyuan commented 1 year ago

In this project, I wanna display a Chinese zodiac image, which contains black text and a red paper cutout. It's beautiful. It can show the power of Chinese character(‘龍’ means dragon) image

here is problem, how to display it?

eleveyuan commented 1 year ago

here is the Programming Principle. So I have to split image into two images(red pixels and black pixels)

eleveyuan commented 1 year ago

lemariva/image2eink give a solution for this situation. and check this link(https://lemariva.com/blog/2019/08/raspberry-pi-displaying-images-eink-screen) for more detail

first use imagemagick to remap picture from a RGB-color scheme to a 3-color scheme

# Create 3 color palette:
magick xc:red xc:white xc:black +append palette.gif
# Image dithering using Floyd-Steinberg:
magick dragon.png -remap palette.gif res_dragon.png

then use lemariva's code to splite picture

image