I have pattern image of 100x100 (vertical linings), i want to rotate it by 120deg. So i used following command.
exec('convert -rotate "120" in.png out.png');
It rotates correctly, but i get white background on all for corners (a diamond pattern) because now pattern image is rotates.
But i want to get square 100x100 image with rotated pattern (120deg).
You don't have enough material to start with, so you kind of have to make some more by repeating what you have.
So, if we start with this as stripes.png
:
You can do this:
convert stripes.png +clone +append +clone -append -rotate 120 -crop 100x100+70+70 result.png
and get:
The sequence +clone +append
duplicates the original image and appends the copy to the right, making it into a new, wider image. The sequence +clone -append
duplicates the new, wider image and appends the clone underneath making a single, new taller image. The image is now twice as wide and twice as high as the original. I then rotate it, and crop out of the middle region.