The version of ImageMagick that I use is : ImageMagick 6.9.7-4 Q16 on Linux Ubuntu.
My goal is to remove background on clothes pictures.
The best result I had is when I use this command but depending on the complexity of background I had bad results:
Code: Select all
convert x.jpeg -fill none -fuzz 4% -draw 'matte 0,0 floodfill' -flop -draw 'matte 0,0 floodfill' -flip -draw 'matte 0,0 floodfill' -flop -draw 'matte 0,0 floodfill' -flip x.png
Example:
before:
after:
So I had the following idea: multiplicate the reference points that I used.
When I implemented that I had a problem because the first matte removed the most parts of background and when the command did the second matte, the picked color is transparent so doesn't do more background remove.
After that I though if before I do the matte I collect all the colors of reference points I want to use. I can give it to convert command.
So I tried to do this but I got an error. For example :
Code: Select all
convert x.jpeg -fill none -fuzz 4% -draw 'matte #ffffffff floodfill' x.png
I want do this that way because when I tried:
Code: Select all
convert x.jpeg -fuzz 4% -transparent ‘#ffffffff’
Ideally I want to be able to do something like:
Code: Select all
convert x.jpeg -fill none -fuzz 4% -draw 'matte 0,0 floodfill' -draw 'matte 0,100 floodfill' -draw 'matte 0,200 floodfill' x.png
If it is not possible I want to find a way to give directly the colors instead of 0,0 or 0,200 .
I really think if I can to this in this way I will get very well result. Because when I do it manually one by one I see all the parts being removed but when I do it all together It doesn't work for the reason explained before.
Thanks a lot!
Ksom