Is it possible to access in a Image Stack (parentheses) the dimensions of an image outside of the Image Stack?
Posted: 2018-01-14T13:47:23-07:00
Hello,
is there a way to access the dimensions of an image which is outside of an Image Stack while you're inside of an Image Stack?
Here is my specific case:
I want to place a picture over another picture. The overhead image may be rotated, but it should always scaled so that it has the maximum possible dimensions relative to the underlying image.
This may look like this:
https://imgur.com/a/C1t3w
https://imgur.com/a/lYbZ6
The following code was executed in Bash on a Ubuntu using ImageMagick 6.8.9-9:
While inside of the Image Stack (parentheses), Attribute Percent Escapes like "%wx%h" refer to the current picture "top.png". So as far as I know, it is necessary split the action into two tasks.
Therefore I'm curious if it is possible to do something like this:
Best regard
AVoeee
is there a way to access the dimensions of an image which is outside of an Image Stack while you're inside of an Image Stack?
Here is my specific case:
I want to place a picture over another picture. The overhead image may be rotated, but it should always scaled so that it has the maximum possible dimensions relative to the underlying image.
This may look like this:
https://imgur.com/a/C1t3w
https://imgur.com/a/lYbZ6
The following code was executed in Bash on a Ubuntu using ImageMagick 6.8.9-9:
Code: Select all
size=`convert pic.png -density 300 -format "%wx%h" info:`
convert pic.png -density 300 \( top.png -rotate 35 -gravity center -resize "$size" \) -compose over -composite "result.jpg"
Therefore I'm curious if it is possible to do something like this:
Code: Select all
convert pic.png -density 300 \( top.png -rotate 35 -gravity center -resize GET_DIMENSIONS_OF_PICTURE.PNG \) -compose over -composite "result.jpg"
AVoeee