Using first image in a layering op. to set output image size
Posted: 2012-10-21T14:54:46-07:00
I have an image layering of the form:
but I want to modify this so that the size of the output file is not fixed at 100x100, but is the same as the dimensions of the first input file. I have looked at "-format" and could probably do it in conjunction with environment variables and the like, but is there a more direct way?
How would I then change the "+50+50" so that it was dynamically calculated to be "Width/2 x Height/2"?
Code: Select all
convert ^
-size "100x100" xc:none ^
^( "a.png" -gravity center -geometry +00+00 ^) -composite ^
^( "b.png" -gravity center -geometry +50+50 ^) -composite ^
"c.png"
How would I then change the "+50+50" so that it was dynamically calculated to be "Width/2 x Height/2"?