AuthorTopic: ROTSPRITE, useful tool  (Read 22621 times)

Offline QuaziGNRLnose

  • 0001
  • *
  • Posts: 93
  • Karma: +1/-0
    • View Profile

ROTSPRITE, useful tool

on: June 18, 2010, 08:11:02 pm
well i do pixel animations sometimes, and nothing is more annoying than dirty rotation tools, when your using rotation to speed things up, either its puts AA everywhere, that you dont want, or it just messing everything up, even if it doesn't add new colours. i was on Wikipedia and i found this when looking at sprite scaling algorithms.



heres a picture of the rotation in action, the first image, non rotated, the second, badly rotated, the third, with rotsprite
as you can see it does a beautiful job, adds no new colours, and im sure some animators who make use of rotation would love it, since it barely needs clean up work.

Quote
RotSprite is a scaling and rotation algorithm for sprites developed by Xenowhirl. It produces far fewer artifacts than nearest-neighbor rotation algorithms, and does not interpolate or anti-alias, so it does not introduce new colors into the image.[6]
The algorithm first scales the image to 8 times its original size with a modified Scale2x algorithm which treats similar (rather than identical) pixels as matches. It then 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 restored if the corresponding pixel in the source image is different and the destination pixel has three identical neighbors.[7]

an excerpt from wikipedia ^

http://info.sonicretro.org/RotSprite
Originally posted by Jeff

I AM A GIANT DONUT MANATEE

Offline Arne

  • 0010
  • *
  • Posts: 431
  • Karma: +1/-0
  • Panties.
    • View Profile
    • AndroidArts

Re: ROTSPRITE, useful tool

Reply #1 on: June 19, 2010, 09:20:27 am
I experimented a lot with this a few years ago, although I scaled up a few times and cleaned up by hand and then drew down scaled in-engine (games can easily do this on the fly). I suggested it for Cortex Command but we ended up not doing it.

Another thing I experimented with was sampling a couple of pixels rather than just one (crisp) or all (blur).

Mipmapping is another technique that works well, because sampling a small blurry image (at a distance) results in less flicker (more representative sample points).
« Last Edit: June 19, 2010, 09:26:35 am by Arne »

Offline QuaziGNRLnose

  • 0001
  • *
  • Posts: 93
  • Karma: +1/-0
    • View Profile

Re: ROTSPRITE, useful tool

Reply #2 on: June 19, 2010, 06:13:02 pm
im curious, does cortex command use per-pixel sampling for its rotation or something else/similar?, from what i remember it was quite well done even in the early demo i have.
Originally posted by Jeff

I AM A GIANT DONUT MANATEE

Offline Arne

  • 0010
  • *
  • Posts: 431
  • Karma: +1/-0
  • Panties.
    • View Profile
    • AndroidArts

Re: ROTSPRITE, useful tool

Reply #3 on: June 19, 2010, 07:37:18 pm
I think it uses plain unfiltered 1x rotation. Pieces of junk are of course irregular with all sorts of angles, but since it's already noisy junk, rotation doesn't hurt much. For weapons and other stuff, a lot of 90 degree angles are used and those survive rotation pretty well. Also, since the things move a lot, some of the ugly rotation artifacts are averaged out.

Raiden II looked pretty good even though it used unfiltered rotation. I think it used a lot of 90 degree angles too.

Offline EyeCraft

  • 0011
  • **
  • Posts: 597
  • Karma: +2/-0
  • What are you scared of?
    • View Profile
    • Death By Dev

Re: ROTSPRITE, useful tool

Reply #4 on: June 22, 2010, 12:52:02 am
Wonderful, I did not know about this. Will no doubt find use for it, danke!

Offline Mathias

  • 0100
  • ***
  • Posts: 1794
  • Karma: +2/-0
  • im not real
    • http://pixeljoint.com/p/9542.htm
    • View Profile

Re: ROTSPRITE, useful tool

Reply #5 on: June 22, 2010, 01:12:52 am
Yes, this is awesome!

Offline st0ven

  • 0010
  • *
  • Posts: 200
  • Karma: +0/-0
    • View Profile
    • spriteart

Re: ROTSPRITE, useful tool

Reply #6 on: June 22, 2010, 03:31:40 am
im quite a fan - wondering how amazing it would be with a more proper ui and some batch processing capabilities <_<  >_>

Offline Pawige

  • 0010
  • *
  • Posts: 293
  • Karma: +0/-0
    • View Profile
    • The Noisy Sanctum

Re: ROTSPRITE, useful tool

Reply #7 on: June 23, 2010, 04:52:36 am
I just wish this was built into Graphics Gale or Promotion. Oh man...That would rock so hard. Barring that, what st0ven said. I've used it so much since I got it! Great tool.

Offline alspal

  • 0001
  • *
  • Posts: 69
  • Karma: +0/-0
  • alastair
    • View Profile
    • My games and things

Re: ROTSPRITE, useful tool

Reply #8 on: June 23, 2010, 01:28:26 pm
Yeah I'd love to see this part of graphics gale or something.

Offline Ai

  • 0100
  • ***
  • Posts: 1057
  • Karma: +2/-0
  • finti
    • http://pixeljoint.com/pixels/profile.asp?id=1996
    • finticemo
    • View Profile

Re: ROTSPRITE, useful tool

Reply #9 on: June 24, 2010, 03:07:03 pm
Integration in any app would require a reference implementation, for a start.
The exe is not sufficient.

Since it's an exe, I want to make my own implementation anyway (Running windows stuff in linux is a bit awkward).
The following parts of the description are not precise enough, IMO:
"It then calculates what rotation offset to use by favoring sampled points which are not boundary pixels."
(are we talking about what position to treat as the image centre?)

"Finally, overlooked single-pixel details are restored if the corresponding pixel in the source image is different and the destination pixel has three identical neighbors."
('single-pixel details' isn't really well enough defined here. Isolated single pixels? single pixels terminating a line? single pixels comprising a 1pix-thick line?)

Though his last activity on that site was in 2007, I'm hoping to get some more specifics out of Xenowhirl.


If you insist on being pessimistic about your own abilities, consider also being pessimistic about the accuracy of that pessimistic judgement.