-fill Command Emulation with Magick++
Posted: 2017-07-14T13:30:40-07:00
Hi all, new here, and I was wondering if you could help me out with a problem:
I want to take an image that I have and replace the alphas of the pixels that match a certain color, with a certain fuzz, with the value 0. That is, make all pixels that don't match a certain color clear using Magick++.
Right now, I have this command in a bash script:
convert \
\( $PICTURE +fuzz -fuzz $REDFUZZ -fill none +opaque red \) \
\( $PICTURE +fuzz -fuzz $GREENFUZZ -fill none +opaque green \) \
-composite -compose plus \
which allows me to take a picture and replace all the pixels that are not red or green, as individual commands, with clear alphas and then mash those two pictures on top of each other.
I want to do this programatically. Any ideas?
I want to take an image that I have and replace the alphas of the pixels that match a certain color, with a certain fuzz, with the value 0. That is, make all pixels that don't match a certain color clear using Magick++.
Right now, I have this command in a bash script:
convert \
\( $PICTURE +fuzz -fuzz $REDFUZZ -fill none +opaque red \) \
\( $PICTURE +fuzz -fuzz $GREENFUZZ -fill none +opaque green \) \
-composite -compose plus \
which allows me to take a picture and replace all the pixels that are not red or green, as individual commands, with clear alphas and then mash those two pictures on top of each other.
I want to do this programatically. Any ideas?