ID:2655373
 
Applies to:
Status: Open

Issue hasn't been assigned a status value.
http://info.sonicretro.org/RotSprite

Don't know how viable this is in BYOND (It might not be performant..?) but this would be a great option to have for rotation.

The algorithm first scales the image to 8 times its original size with a modified Scale2× algorithm which treats similar (rather than identical) pixels as matches. It then (optionally) calculates what rotation offset to use by favoring sampled points which are not boundary pixels. Next, the rotated image is created with a nearest-neighbor scaling and rotation algorithm that simultaneously shrinks the big image back to its original size and rotates the image. Finally, overlooked single-pixel details are (optionally) restored if the corresponding pixel in the source image is different and the destination pixel has three identical neighbors.

Details on how the algorithm works from Wikipedia.

This is also the default rotation algorithm used by Asesprite, which is open source.
This has actually been on my personal wish list for some time. The trick is there's currently not a shader version of RotSprite.

RotSprite works by first upscaling the image in a specific way, then rotating and doing a modified nearest-neighbor interpolation on the result. The upscaling method basically doubles the image in size in three passes to make it 8x larger. It might be very difficult to make this work in a shader.