문제

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
도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top