CleanEdge - rotate your images without blurring (my first extension)

Hey guys, after a few weekends, I’ve created my first extension. This one will rotate a sprite’s image by any degree, and doesn’t suffer from blurring.

I’m not too sure what to do about it, other than give it to my son, who was asking for this functionality.

It’s a port of torcado’s cleanEdge project. Here’s the github link to the extension:

github.com/Marupio/arcade-cleanEdge

This gives you a single block that takes the sprite image as an input, and returns the rotated image. It doesn’t work directly with Sprites at the moment.

It’s a bit laggy, so maybe next version should create a cache of images when first created, then summon the correct image as needed. It also could use some fine-tuning to make the images come out a bit better.

Here’s a demo app I created:

The demo shows two sprites, one that rotates nicely, and the other with fine details that get muddled by the algorithm. It does have limitations, especially around fine details.
Enjoy, all who care to try it!

All the best!

2 Likes

I always love to see more rotation algorithms. Great work on the extension, I am excited to see what you do with it. You could maybe take a look at sprite rot, which runs pretty well. Having a Blast with MakeCode Arcade! - #6 by AlexK
@AlexK since it was your rotation extension, do you have any tips or thoughts?

1 Like

Thanks, BotWarrior!

I did have a look at the other rotation / scaling extension. It does interpolation, so it’s not as fancy as torcado’s cleanEdge work, but it is much faster.

I’ve been slowly adding to it. There are 7 new blocks now. It now rotates around a point, it can precalculate all rotations to speed things up. It scales now too (torcado originally did a scaling algorithm as well). Other minor changes to the interface as well.

I will continue working on this… albeit slowly!

Thanks for the encouragement!

2 Likes

I might have to use your extension in the future! I often have a vast amount of projectiles sharing the same image, pre-calculating all images at the start could considerably speed up the process. Keep up the good work :slight_smile: