Multiple Commands with ImageMagick
<p>I have the following files:
background.jpg
element1.jpg
element2.jpg</p>

<p>I would like to take element1.jpg, resize it to 300x300, place it on background.jpg, and then take element2.jpg, resize it to 400x400 and place it on the background. I would NOT like the background to be resized.</p>

<p>This is my current command. It appears that resize 400x400! is applied to all the previous images in memory (background.jpg and element1.jpg), instead of one specific image.</p>

<pre><code>convert background.jpg -page +0+0 -resize 300x300! element1.jpg -page +0+0 -resize 400x400! element2.jpg -layers flatten output.jpg
</code></pre>

<p>Is there a way to accomplish this without creating a tmp folder to save "middle steps" and have it done all in one command? Or, is there a way to use "brackets" to specify which commands to run first?</p>