I have this issue with rotation that I cant solve since few days. Im trying to build an image which has several images (items) over each other. I have successfully done the item insertions with specific size and position of each item.
However, when i try to rotate the items to be placed (with "rotate" or even by "affine"), the items are rotated but displaced. i believe it has something to do with the center of rotation being the top left of the canvas.
Example:
This is the without rotation.

Now with rotation (using manual graphics tools) - rotated to -50degs (this is what is needed)

Now with imagemagick code - rotated by only 5degs (otherwise it goes outside canvas)

As you can see it starts moving away from its location as i start rotating it. I dont have the same image all the time nor the same size so its not possible to apply a "translate" everytime.
-