Image A:
Image B:
Image C:
What I would personally do if Image B were a single color background is this:
Code: Select all
convert 'IMGA.png' -level-colors "$col,#00FF00" \
-alpha copy +level-colors '#00FF00,#00FF00' \
'IMGC.png'
Code: Select all
convert 'IMGA.png' -level-colors "$col,#00FF00" \
-alpha copy +level-colors '#00FF00,#00FF00' \
'IMGC.png'
Code: Select all
convert dtMQHtn.png OBN2242.png +swap -compose divide -composite -fuzz 30% -channel rgba -fill none +opaque "#74FF73" tmp.png
Code: Select all
%IM%convert ^
exA.png ^
-fill White -colorize 100 ^
wht.png
%IM%convert ^
( exA.png exB.png -compose MinusSrc -composite ) ^
( wht.png exB.png -compose MinusSrc -composite ) ^
-compose DivideSrc -composite ^
-channel G -separate +channel ^
alph.png
%IM%convert ^
exA.png ^
-fill #0f0 -colorize 100 ^
alph.png ^
-alpha off ^
-compose CopyOpacity -composite ^
fndC.png
Code: Select all
%IM%convert exB.png fndC.png -compose Over -composite calcA.png
%IM%compare -metric RMSE calcA.png exA.png NULL: