I'm trying to extract a mask from picture, based on some specific color from some point.
source pic:

what I need to get when I use the command with x=200 & y=700 (yellow pixel at his right feet):

I think that the line I'm using can explain a lot better what I'm trying to achieve:
Code: Select all
convert $pic \( +clone -fill white -fuzz $fuzz% -draw 'color $x,$y replace' \) +swap -compose ChangeMask -composite $mask"
So I appended a extra +matte to the end of the command, but it didn't work. Then I tried this:
Code: Select all
convert $mask +matte test.gif
Code: Select all
convert $pic \( +clone -fill white -fuzz $fuzz% -draw 'color $x,$y replace' \) +swap -compose ChangeMask -composite miff:- | convert - +matte $mask
What I'm missing? Or is there a more straightforward way to do the whole thing?
Thanks in advance,
Tiago