Ignore transparent pixels in subimage search
Posted: 2018-11-01T02:13:41-07:00
Hello,
I've attached 2 images big.png and small.png. Is it possible to tell IM to ignore transparent pixels in small.png when doing subimage seach against big.png? That way, the matching metrics would be better.
I'm well aware of the -read-mask feature. In fact, I've created the small_mask.png image by filling the transparent pixels in small.png with black and the rest with white. Using the mask, my matching metrics indeed decreased from 0.15 to 0.09 (exactly what I want). However, create the extra mask is redundant work because the mask is already embedded in the transparent pixels. I've also tried all the -alpha options without expected results.
So, basically, is there a way to activate -read-mask by just using transparent pixels, instead of having to create the actual mask image? Thanks, in advance.
big.png
https://www.dropbox.com/s/w5bo26s42vrmmng/big.png?dl=0
small.png
https://www.dropbox.com/s/0ablbgzxwcrj7 ... l.png?dl=0
small_mask.png
https://www.dropbox.com/s/fwflp6gqq5pv2 ... k.png?dl=0
I've attached 2 images big.png and small.png. Is it possible to tell IM to ignore transparent pixels in small.png when doing subimage seach against big.png? That way, the matching metrics would be better.
I'm well aware of the -read-mask feature. In fact, I've created the small_mask.png image by filling the transparent pixels in small.png with black and the rest with white. Using the mask, my matching metrics indeed decreased from 0.15 to 0.09 (exactly what I want). However, create the extra mask is redundant work because the mask is already embedded in the transparent pixels. I've also tried all the -alpha options without expected results.
So, basically, is there a way to activate -read-mask by just using transparent pixels, instead of having to create the actual mask image? Thanks, in advance.
big.png
https://www.dropbox.com/s/w5bo26s42vrmmng/big.png?dl=0
small.png
https://www.dropbox.com/s/0ablbgzxwcrj7 ... l.png?dl=0
small_mask.png
https://www.dropbox.com/s/fwflp6gqq5pv2 ... k.png?dl=0