Convert and Dither image to support 3 color epaper display

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
rlightner
Posts: 3
Joined: 2019-07-23T07:45:20-07:00
Authentication code: 1152

Convert and Dither image to support 3 color epaper display

Post by rlightner »

I'm working with an epaper display that supports Black/White/(Red / Yellow) and would like to dither a full color image to just those 3 colors for display. I have no problems dithering to 2 colors (Black/White), but having some issues with this third color. Anyone done this or can point me in the right direction? Thanks!
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Convert and Dither image to support 3 color epaper display

Post by snibgo »

What version of IM, on what platform?

You can easily remap to any number of colours, with dithering. For example:

Code: Select all

magick xc:black xc:white xc:red +append +repage +write mpr:MAP +delete toes.png -remap mpr:MAP dith3.png
Image
snibgo's IM pages: im.snibgo.com
rlightner
Posts: 3
Joined: 2019-07-23T07:45:20-07:00
Authentication code: 1152

Re: Convert and Dither image to support 3 color epaper display

Post by rlightner »

I'll be using convert via a firebase function.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Convert and Dither image to support 3 color epaper display

Post by snibgo »

I know nothing about firebase. You may need "convert" instead of "magick".
snibgo's IM pages: im.snibgo.com
rlightner
Posts: 3
Joined: 2019-07-23T07:45:20-07:00
Authentication code: 1152

Re: Convert and Dither image to support 3 color epaper display

Post by rlightner »

Yup, I was able to use convert. Thank you very much for the assistance! I added -dither FloydSteinberg which cleaned up my test image as well.
Post Reply