Tool for creating rotated versions of an image
In sprite-based systems, it is common to fake sprite rotation, having many different images, each showing that it rotates a few degrees.
Is there a free tool that will take one image and output one image containing multiple revolves? It should also perfectly control how many images are in each line.
For example, if I have a 32x32 sprite and I want it to rotate at 10 degree intervals, the tool could generate a 320x32 file or a 160x64 file
a source to share
-
Download imagemagick (command line imaging tools)
-
convert image.png -rotate 10 10-image.png
-
convert -page +0+0 image.png -page +32+0 10-image.png -mosaic final.png
You can have as -page +X+Y imagefile
many as you like per line. The final image size will be calculated from the extents of the pages you are using and the sizes of the input files.
You can link this together with a script of your choice. There are bindings for most of the major languages if you don't want to go to the command line tools.
a source to share
To do the Ajax spinning I used imagemagick as suggested by Lou, but ran into a problem with the "rotate" option because it can make the image larger (imagine a square at a 45 degree angle).
I found that the solution was to use the "distortion" option with the ScaleRotateTranslate (SRT) method, just using a rotation element. This gave me the results I was looking for.
Example:
convert a.png -distort SRT 33 b.png
to rotate the a.png 33 degrees and save as b.png.
a source to share