Question

convert 'a.png' \
\( -background none -geometry 100x100+150+50! -rotate 5 'b.png' \) \
-composite 'a.png';

This is a simple script to rotate and place an image b on top of image a. My problem is that image b is being rotated within the defined area (100x100):

bad

How do I rotate the whole image frame as such:

good

Or, put it simple:

enter image description here

  1. is the original picture (a) with (b) picture on top of it
  2. picture two is how im rotates the (b) picture
  3. is how I need the picture rotated
Was it helpful?

Solution

With a little help from Freenode community, here is the answer:

convert 'a.png' \( 'b.png' -resize 100x100 -rotate 50 \) -geometry +100+50 -composite 'a.png';

The problem was that -geometry restricted the rotated element to the specified dimensions.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top