Page 1 of 1

Replace ALL colors except black-grey scales with white

Posted: 2020-01-09T07:22:05-07:00
by bodomalo
Hello

I know that it is possible to replace a specific color (like RED) and similar colors (fuzzy:30%) with another color.
convert thing.jpg -fuzz 15% -fill white -opaque "rgb(143,141,250)" -opaque "rgb(216,217,62)" result.png

But:
What I would like to have as a result is, that ALL colors beside black and grey-tones are replaced with white "000000"

Can you give me a hint how to do that?

Re: Replace ALL colors except black-grey scales with white

Posted: 2020-01-09T09:24:02-07:00
by snibgo

Code: Select all

magick in.png ( +clone -colorspace HSL -channel 1 -separate -threshold 0 ) -compose Lighten -composite out.png

Re: Replace ALL colors except black-grey scales with white

Posted: 2020-02-05T08:43:36-07:00
by bodomalo
snibgo wrote:
2020-01-09T09:24:02-07:00

Code: Select all

magick in.png ( +clone -colorspace HSL -channel 1 -separate -threshold 0 ) -compose Lighten -composite out.png
It says syntax error, did not expect a ( sign on that place.....

Re: Replace ALL colors except black-grey scales with white

Posted: 2020-02-05T08:48:32-07:00
by bodomalo
magick in.png \( +clone -colorspace HSL -channel 1 -separate -threshold 0 \) -compose Lighten -composite out.png

that worked...looks great, thank you