I actually do have all the coordinates, I just meant I want to use the original image corners for the distort.
I am actually doing what your approach says, something is going wrong if more than two images are merged though.
Look at this, I merge 2 with this code:
"magick.exe" ^
( "logo.jpg" ( -size 123x118 xc:black -fill white -stroke white -draw "polygon 23,18 23,113 113,113 113,18 23,18" ) -alpha off -compose CopyOpacity -composite ) ^
( ( "logo.jpg" ( -size 123x118 xc:black -fill white -stroke white -draw "polygon 23,18 23,113 113,113 113,18 23,18" ) -alpha off -compose CopyOpacity -composite ) -alpha set -virtual-pixel transparent +distort affine "0,0 -90,0 0,118 -90,118" ) ^
-compose over -layers merge +repage "C:\Users\james\Desktop\NewLogos.jpg"
I get this (correct, worked perfect):
If I do the exact same thing, but add another image in the row so 3 images, it does not mask the third image, code is:
"magick.exe" ^
( "logo.jpg" ( -size 123x118 xc:black -fill white -stroke white -draw "polygon 23,18 23,113 113,113 113,18 23,18" ) -alpha off -compose CopyOpacity -composite ) ^
( ( "logo.jpg" ( -size 123x118 xc:black -fill white -stroke white -draw "polygon 23,18 23,113 113,113 113,18 23,18" ) -alpha off -compose CopyOpacity -composite ) -alpha set -virtual-pixel transparent +distort affine "0,0 -90,0 0,118 -90,118" ) ^
( ( "logo.jpg" ( -size 123x118 xc:black -fill white -stroke white -draw "polygon 23,18 23,113 113,113 113,18 23,18" ) -alpha off -compose CopyOpacity -composite ) -alpha set -virtual-pixel transparent +distort affine "0,0 -180,0 0,118 -180,118" ) ^
-compose over -layers merge +repage "C:\Users\james\Desktop\NewLogos.jpg"
Image result is (incorrect as the left image is not masked at all):
Why in the world did that left-most image not get masked?
If we can answer that, I think we found the problem.