I'm trying to montage several images, and offset some of those images before the final output image is created.
I'm using 3 png files with transparency as my source files, and hoping to arrange all 3 images side-by-side as a png with transparency as my output file.
Input1.png = 800x3000 (no offsetting required)
Input2.png = 800x3000 (the image needs to be offset so that the bottom 100 pixels are cropped, and the new bottom aligns with the bottom of Input1.png)
Input3.png = 800x3000 (the image needs to be offset so that the bottom 200 pixels are cropped, and the new bottom aligns with the bottom of Input1.png)
The outputfile, Output.png, should have a height of 400, and be 1 row of input images.
I tried the montage approach, but, initially, the only way I can get it to work was to crop Input2.png by explicity providing the y-value (3000-100=2900). Ideally I could do this just by offsetting the page, like with other commands?
For example, this seems to work, but what if I don't know the image height (in order to calculate the crop size)?
Code: Select all
montage input1.png input2.png[x2900+0+0] input3.png[x2800+0+0] -background none -tile x1 -geometry x400+1+1 output.png
Code: Select all
montage input1.png input2.png[x3000+0-100] input3.png[x3000+0-200] -background none -tile x1 -geometry x400+1+1 output.png
Code: Select all
montage input1.png input2.png[x%h+0-100] input3.png[x%h+0-200] -background none -tile x1 -geometry x400+1+1 output.png
Code: Select all
montage input1.png input2.png[x3000+0+100] input3.png[x3000+0+200] -background none -tile x1 -geometry x400+1+1 output.png
I'd rather not have to calculate the crop height, or even know the image height. Furthermore, I'm working with large images, so it might be more efficient to read the files with just a #x# read modifier, to keep them small as they're loaded in. (sidenote: It's a shame you can't resize AND crop using a read modifier.)
Maybe the viewport flag could be used in the read modifier (it doesn't seem to be supported now), and then it would be possible to viewport the image/canvas.
The only other apprach I can think of is using a delegate.
Or am I missing something?