title: How can I concatenate a Corner Pin and Composite in ImageMagick?
body: <p>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:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>For some reason Windows doesn't respond to grouping these commands in parentheses as I would expect:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>For some reason when I execute the above command it opens Viewers for each image, and the output is wrong.</p>
  
  <p>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.</p>
  
  <p>Many thanks!</p>