Defining the rotation center within a composition

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
euhost

Defining the rotation center within a composition

Post by euhost »

Dear IM-Users,

I have one background (theme.jpg) where i want to position an resized .jpg image (pic.jpg) on it.
Very often this pic.jpg needs to be rotated by its center point, which is driving me crazy.

The rotation is done by its bottom left corner (if value>0). I need to rotate the image by its center point.
Any hint how to do this?

Code: Select all

1. composite -geometry +70+81 \( pic.jpg[200x178] -matte -background none \) theme.jpg 
2. composite -geometry +70+81 \( pic.jpg[200x178] -rotate 20 -matte -background none \) theme.jpg out2.jpg
1. No Rotation
Image

2. rotate 20
Image

Here are the source images:
http://collage.artido.exxs.net/1/pic.jpg
http://collage.artido.exxs.net/1/theme.jpg

Thank you in advance
Matthias
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Defining the rotation center within a composition

Post by fmw42 »

convert theme.jpg \( pic.jpg -resize 200x178 -background none -rotate 20 \) -gravity center -composite theme_pic.jpg
Post Reply