[Idea] waifu2x/xBRZ "hybrid" sprite scaling method

Show off your mod creations or just a work in progress.
Post Reply
User avatar
MrFlibble
Posts: 410
Joined: Sat Jan 27, 2018 10:43 am

[Idea] waifu2x/xBRZ "hybrid" sprite scaling method

Post by MrFlibble »

I'm playing around with waifu2x and it seems that this tool gets pretty good results when dealing with images produced from 3D renders. However, when it comes to sprites the edges are handled poorly:
Image

On the other hand, xBRZ can produce smoother sprite edges yet does little to enhance image detail:
Image

So I thought that combining both methods might produce an overall better result. The obvious solution is to keep the external outline of the xBRZ sprite and impose it over the version produced by waifu2x:
Image

Clearly not perfect but rather fine I suppose. I kept an outline 3 pixels thin which I produced by first discolouring the xBRZ sprite to just a shape of single solid colour and then gradually removing the three outer pixel outlines (I suppose there may be a faster way to achieve this but I'm not aware of any at the moment).

I guess that the outer shape may be further refined manually but I haven't tried that.

For waifu2x processing I used this implementation, and the xBRZ Scaler Test tool is available here.

User avatar
King of Worms
Posts: 4751
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow (CZ)
Contact:

Re: [Idea] waifu2x/xBRZ "hybrid" sprite scaling method

Post by King of Worms »

I came to the same conclusion. If this can be automatized, than its a deal. If not, its a ordeal :) Because we talking 5000 sprites for animated NPCs here. So I went with XBR4x and than batch reduced the resolution by 50%. That way, I got the best results I was able to achieve & even this simplified process almost killed me. I tryed using scripting where it was possible, thanks Lacus for that. But the process has too many steps anyway... it was hard core FOR ME... I needed to set up a secondary monitor just for that and my both monitors were full of windows - one error = disaster somewhere in the game. It TRULY hurt my brain. Cant Imagine doing this with any additional step. But Im not some guru - quite contrary - so it might be possible to find a better way to do that than I did OFC!

User avatar
MrFlibble
Posts: 410
Joined: Sat Jan 27, 2018 10:43 am

Re: [Idea] waifu2x/xBRZ "hybrid" sprite scaling method

Post by MrFlibble »

I played around a bit more with this, and also used some feedback I got in the Duke4.net forums. Here's a result of a small semi-random selection of pre-rendered sprites (converted to the original Daggerfall palette):
Image

This time I used only a one pixel thin outline created by xBRZ, but also created a one pixel thick border around the original sprites for waifu2x upscaling so that it would not produce colour burn around the sprites' edges.

Also, as per Phredrekee's suggestion, I added noise using the HSV noise tool in GIMP.

I didn't edit the resulting images in any other way although some stuff like the hammer and axe handle could be smoothed to look more straight. I supposed that if fully animated, and against the game's background, the shortcomings should not be very obvious.

User avatar
King of Worms
Posts: 4751
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow (CZ)
Contact:

Re: [Idea] waifu2x/xBRZ "hybrid" sprite scaling method

Post by King of Worms »

I like the upscaling community :) One day we will find some ultimate solution - but I guess some kind of AI will be used as well. Thanks for sharing! And that noise pass is kinda cool ;) Results on the armored guy are quite interesting - Id say very good. I dont like the dancing lady results too much to be honest

User avatar
MrFlibble
Posts: 410
Joined: Sat Jan 27, 2018 10:43 am

Re: [Idea] waifu2x/xBRZ "hybrid" sprite scaling method

Post by MrFlibble »

King of Worms wrote: Sat Jun 23, 2018 9:08 pm I dont like the dancing lady results too much to be honest
I don't like it either :) She needs a lot of manual clean-up, probably including before scaling to get the dark pixels away from the edges, but also since the original sprite has very low detail there isn't much for waifu2x to enhance.

At least we have higher resolution versions of two dancers including this one thanks to NUKE:
Image Image
Since all dancers of this type are basically reskins of the same model with the same animation cycle I guess it would not be impossible to create higher resolution sprite sets for all of them based on these two (or rather, based on the hooded one).

Hopefully more high-res stuff could be found some day from other sources. (Of course the ideal thing would be if Bethesda recovered their Daggerfall archives with the source code too, but frankly I can't even tell how likely this is to ever happen.)

It appears that many of the characters were rendered at a higher resolution and then scaled down using some imperfect methods which resulted in pixel artefacts around the edges.

User avatar
King of Worms
Posts: 4751
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow (CZ)
Contact:

Re: [Idea] waifu2x/xBRZ "hybrid" sprite scaling method

Post by King of Worms »

Right, and not only were the sprites scaled down, but animation windows were removed due to the memory constraints.
I used these higher res animated dancers in my remaster 3.0 which will be released "soon" + one of the mages.
I also cleaned them up a bit manually. Im afraid Beth will never do sh1t for Daggerall, we are solely on our own here ;)

Post Reply