pythonimage-processingdithering

Creating 3 color dithering image


Hello I am trying to convert an image from full color image to 3 colors dithering image to convert this image

enter image description here

to this one

enter image description here

I don't have a clue how to do this, but I assume that I need to first change source image to tri color image (Black - White - Red) then apply dithering on it, so I am not sure how to convert a fully colored image into 3 colors only.


Solution

  • I found what I was looking for in this post https://learn.adafruit.com/preparing-graphics-for-e-ink-displays/command-line The answer was to use library like ImageMagick instead of opencv. I can do a dithering on one line command

    convert input.jpg -dither FloydSteinberg -define dither:diffusion-amount=85% -remap eink-3color.png BMP3:output.bmp
    

    the eink-3color.png is this one

    enter image description here