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?".
Not how I imagined it.
I probably need some approach to keep it centered. right ?
[Bonus points for whomever can figure out a way to make this script easier... like: execute once and output a user set numbers of roations aka 001. 002. 003. etc.)
Thanks in advance
Last edited by Rye on 2016-01-31T12:08:33-07:00, edited 1 time in total.
Version: ImageMagick-7.0.7-28-Q16-x64-static http://www.imagemagick.org
Copyright: Copyright (C) 1999-2018 ImageMagick Studio LLC
The ordinary "-rotate" will make the output large enough to hold the rotated input. So the output at 45 degrees will be bigger than at 0 degrees or 90 degrees. The problem isn't centering, but sizing.
One cure is to do an "-gravity Centre -extent" after each rotation, so it always enlarges to the same size.
The only maths needed is to find the maximum space the image will occupy when rotated. The maximum space is a square, with sides equal to the diagonal of the image. Make the extent that size or larger.
For example, a Windows command to rotate the built-in "rose":
move *.png source.png
for /L %%i in (0,10,90) do convert source.png -trim -rotate %%i -gravity Center -extent 1000x1000 +repage r_fr_%%i.png
for %%x in (*png) do convert %%x -gravity Center -extent 480x800+0+0 +repage %%x
is pretty much perfect in execution !
The only question I now have left is:
How can I get this to create 12 frames "aka" 180° rotation ?
EDIT: I guess executing the script x2 and renaming the files did the trick.
Thanks
Version: ImageMagick-7.0.7-28-Q16-x64-static http://www.imagemagick.org
Copyright: Copyright (C) 1999-2018 ImageMagick Studio LLC