In ImageMagick, I can create a composite in three discrete steps. I corner pin the first image, then the second image. I then composite and place those two images on top of the background image:
convert .\source1.png -matte -virtual-pixel transparent -distort Perspective '0,0,27,211 0,278,197,266 500,0,176,19 500,278,323,48' source1a.png
convert .\source2.png -matte -virtual-pixel transparent -distort Perspective '0,0,2,72 0,278,86,181 500,0,215,2 500,278,311,85' source2a.png
convert .\card.png -page +253+41 .\source2a.png -page +0+98 .\source1a.png -layers flatten fred4.png
For some reason Windows doesn’t respond to grouping these commands in parentheses as I would expect:
convert .\card.png -page +253+41 (.\source1.png -matte -virtual-pixel transparent -distort Perspective '0,0,27,211 0,278,197,266 500,0,176,19 500,278,323,48') -page +0+98 (.\source2.png -matte -virtual-pixel transparent -distort Perspective '0,0,2,72 0,278,86,181 500,0,215,2 500,278,311,85') -layers flatten fred4.png
For some reason when I execute the above command it opens Viewers for each image, and the output is wrong.
Is there a way to do this without having to write out the two intermediate images? Ideally, I could place the image on the background, then do the corner pin in the coordinate space of the background image. Any ideas would be extremely helpful.
Many thanks!
When you group commands with parentheses you are required to leave (at least) one blank on each side of the
(and)characters. This is well documented, and also all the examples do show it! (On Unix one has even to escape them and use\(and\)for grouping ImageMagick commands).So this should work for you on Windows: