New Compare Feature Using Read Mask
Posted: 2016-12-15T15:19:45-07:00
As of IM 7.0.3.9, IM allows a read-mask to be used to limit the regions to be compared. This is not back-ported to IM 6.
As before, a perfect compare has partially transparent white overlay (lowlight-color), non-matches has partially transparent red overlay (highlight-color) and now the ignored regions from the mask have partially transparent gray overlay.
For example:
Image1
Image2
Read-Mask:
0 (0)
Swapping the two images:
0 (0)
Similarly for subimage-search compares. But the read-mask and associated image must be enclosed in parentheses. Also the ignored region will be red (highlight-color) for the time being.
0 (0) @ 417,44
In IM 7.0.3.10, one can specify the masklight color (only for same sized image compares) which defaults to partially transparent gray.
As before, a perfect compare has partially transparent white overlay (lowlight-color), non-matches has partially transparent red overlay (highlight-color) and now the ignored regions from the mask have partially transparent gray overlay.
For example:
Image1
Image2
Read-Mask:
Code: Select all
magick compare -metric rmse -read-mask hat_mask_124_124_417_44.png hat_124_124_417_44.png hat_124_124_417_44_green.png hat_diff_A.png
Swapping the two images:
Code: Select all
magick compare -metric rmse -read-mask hat_mask_124_124_417_44.png hat_124_124_417_44_green.png hat_124_124_417_44.png hat_diff_D.png
Similarly for subimage-search compares. But the read-mask and associated image must be enclosed in parentheses. Also the ignored region will be red (highlight-color) for the time being.
Code: Select all
magick compare -metric rmse -subimage-search -dissimilarity-threshold 1 logo: \( -read-mask hat_mask_124_124_417_44.png hat_124_124_417_44_green.png \) hat_diff_C.png
In IM 7.0.3.10, one can specify the masklight color (only for same sized image compares) which defaults to partially transparent gray.
Code: Select all
magick compare -metric rmse -define compare:masklight-color=blue -read-mask hat_mask_124_124_417_44.png hat_124_124_417_44.png hat_124_124_417_44_green.png hat_diff_B.png