Making rotated versions of sprites is usually a pain in the ass, because most programs that rotate a sprite will antialias it (which blurs it and messes with the colors) and ones that don't antialias it tend to do a poor job of preserving features of the original image. It usually takes a lot of manual touch-up work to make the rotated sprite look good. (If you didn't know already, the walking and running frames in Sonic 1, 2, and 3 all need 45 degree rotated equivalents, and I believe those were custom-drawn by the artists at Sega for lack of any good way of generating them)
So I wrote a little utility to avoid those problems: It can rotate sprites at arbitrary angles without antialiasing and (IMHO) without making them look demented. I call it rotsprite because I suck at inventing names and don't care. It attempts to preserve lines and (to some extent) curves in the original image, it never mixes colors together, and it considers multiple rotation offsets to minimize error. It can optionally scale up or down while rotating.
It isn't perfect; it minimizes error by a very simple method, but won't try to intelligently recognize and eliminate oddities like a human could. Other, simpler methods may do better for certain parts of the image, but rotsprite output should require much less touch-up work overall. It works best on small images, so the quality of rotation can suffer if you place many sprites in an image and rotate the whole image instead of rotating them separately. Dithering (fine-grained checkerboard patterns) can confuse it because it tries to rotate the pattern itself without considering it a single color, so if you need to rotate something dithered I suggest replacing the dithered parts with solid blended colors before rotation, and replacing those colors with the dithering pattern after rotation.
The program asks for input when you open it, should be self-explanitory. To use it as a commandline utility, here are the flags:
rotsprite -in "input.png" -out "output.bmp" -angle 22.5 -endangle 180 -scale 1.0 -endscale 1.0 -frames 8
Now for some sample output:
Creating angled frames for an animation without them:

Comparing automatically rotated sprites with Sega's actual final rotated sprites:

More comparison between regular aliased rotation and this program's output:

Fun with upscaling and rotation:

Making a silly animation (64 rotation angles):

If you missed the download link here it is again: http://www.fileden.c...3/rotsprite.zip
So I wrote a little utility to avoid those problems: It can rotate sprites at arbitrary angles without antialiasing and (IMHO) without making them look demented. I call it rotsprite because I suck at inventing names and don't care. It attempts to preserve lines and (to some extent) curves in the original image, it never mixes colors together, and it considers multiple rotation offsets to minimize error. It can optionally scale up or down while rotating.
It isn't perfect; it minimizes error by a very simple method, but won't try to intelligently recognize and eliminate oddities like a human could. Other, simpler methods may do better for certain parts of the image, but rotsprite output should require much less touch-up work overall. It works best on small images, so the quality of rotation can suffer if you place many sprites in an image and rotate the whole image instead of rotating them separately. Dithering (fine-grained checkerboard patterns) can confuse it because it tries to rotate the pattern itself without considering it a single color, so if you need to rotate something dithered I suggest replacing the dithered parts with solid blended colors before rotation, and replacing those colors with the dithering pattern after rotation.
The program asks for input when you open it, should be self-explanitory. To use it as a commandline utility, here are the flags:
rotsprite -in "input.png" -out "output.bmp" -angle 22.5 -endangle 180 -scale 1.0 -endscale 1.0 -frames 8
Now for some sample output:
Creating angled frames for an animation without them:
Comparing automatically rotated sprites with Sega's actual final rotated sprites:
More comparison between regular aliased rotation and this program's output:
Fun with upscaling and rotation:

Making a silly animation (64 rotation angles):

If you missed the download link here it is again: http://www.fileden.c...3/rotsprite.zip
This post has been edited by Xenowhirl: 17 January 2007 - 02:40 PM


00
