Scale2X Java Source

I’ve just written code for the scale2x and 3x algorithms. This algorithm takes old style sprites (you know, thick colours, defined lines) and attempts to scale them up without losing detail. Code is here, with some minor examples:

http://www.cokeandcode.com/scale2x/

Kev

erikd, hope you’re reading this - coz you gotta implement it in JEmu!

Now I’ve worked out hot to post images [never knew, after years] :

Source Image:

http://www.cokeandcode.com/scale2x/randam_orig.png

Standard 3x Scaling:

http://www.cokeandcode.com/scale2x/randam_orig_rawscale3.png

Scale3x Scaling:

http://www.cokeandcode.com/scale2x/randam_orig3x.png

I’m impressed by the algorithm at least. Note how the colours are intact, no blurring and relatively smooth lines even at 3x scale up. I’ve not tried it but I guess you could scale down to exact size you wanted.

Kev

very impressive :slight_smile: I see it’s also used in WinUAE, I’m going to try it :slight_smile: Had no time to play with emulators recently :frowning:

Thanks for sharing the code. I will probably use it on one of my projects. :slight_smile:

These classes are real nice! In the JEF library there has been a scale2x renderer for quite some time already, though. The algorithm in JEmu was ported from AdvanceMAME. But I guess now I’ll have too implement scale3x too :wink:
This weekend I’ll try to find time to upload a new version of JEmu2, with the scale2x renderer and scanlines renderer options exposed in the front end.

That is nice, the enlarged sprites actually have a cool hand drawn look to them now. :smiley: