AI Upscaled Textures

Show off your mod creations or just a work in progress.
User avatar
King of Worms
Posts: 1509
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow
Contact:

Re: AI Upscaled Textures

Post by King of Worms » Sat Mar 09, 2019 7:54 pm

HI Mason, Im here to bother you again :oops:
Can you please try to upscale these files? The stone borders will be easy, Im not sure about the arrows tho.
Maybe try one and if it doesnt work, I will have to recreate them in some other way...

Thank you! (yea, its just 6KB :D )
map.rar
(6.17 KiB) Downloaded 8 times

MrFlibble
Posts: 107
Joined: Sat Jan 27, 2018 10:43 am

Re: AI Upscaled Textures

Post by MrFlibble » Sun Mar 10, 2019 2:42 pm

Kamer wrote:
Wed Mar 06, 2019 11:16 pm
If we can get those scripts then I won't really need to work on the 3d models anymore. I wouldn't see the point in it if we can get the df prites looking this good.
Phredreeke declined to share the scripts but kindly agreed to process the Daggerfall sprites using his method. I've been sending the results via PM to MasonFace but I think they could be useful to other folks here:
https://mega.nz/#!YmZy2AwS!7YG_poZMeDaA ... nhgUUJXhis
https://mega.nz/#!BrAREaLA!mplOHEB0a-5_ ... 1i4Od68OMY
http://s000.tinyupload.com/index.php?fi ... 6189185165

Please note that this is far from being complete. The sprites are scaled with an ESRGAN interpolated model (default * Manga109) with anti-aliasing pre-processing developed by Phredreeke to improve the results.

As for the possibility of models becoming useless, that's not true, if only because the sprites have a limited set of animation frames. In fact, scaling the sprites up makes the low number of animation frames very obvious.

User avatar
MasonFace
Posts: 253
Joined: Tue Nov 27, 2018 7:28 pm
Contact:

Re: AI Upscaled Textures

Post by MasonFace » Sun Mar 10, 2019 4:35 pm

Can you please try to upscale these files? The stone borders will be easy, Im not sure about the arrows tho.
Below are the upscaled UI elements. As expected, the arrows didn't turn out great. Should be easy enough for someone to do manually.

https://drive.google.com/open?id=1Yk96Z ... yLnYyj6mwr

P.S., it would be easier for me if you could send all the remaining UI elements that you need upscaled in one go. It's easier to do it all in one batch rather than many small batches.

User avatar
MasonFace
Posts: 253
Joined: Tue Nov 27, 2018 7:28 pm
Contact:

Re: AI Upscaled Textures

Post by MasonFace » Sun Mar 10, 2019 5:39 pm

MrFlibble wrote:
Sun Mar 10, 2019 2:42 pm

Phredreeke declined to share the scripts but kindly agreed to process the Daggerfall sprites using his method.
I've been comparing the results between his method and my own and they both seem to have their own unique strengths and weaknesses. I'll compare the results on a particularly difficult sprite frame (484_21-3).

I'll start with Phredreeke's:
21-3_Phredreeke.png
21-3_Phredreeke.png (87.54 KiB) Viewed 594 times
His method doesn't seem to contour the outer edge of the subject as tightly as it should which leaves a pronounced black border around the subject. This wouldn't look bad if the border was a consistent thickness, but it varies along the edges.

21-3_Phredreeke_Undercut.png
21-3_Phredreeke_Undercut.png (81.79 KiB) Viewed 594 times
If I grow his mask by 1 pixel and effectively undercut it, the black outline disappears, but some edges get misshaped and some thin bodies get detached (see top of the bow).

My method:

21-3_Masonface2.png
21-3_Masonface2.png (85.7 KiB) Viewed 594 times
On the other hand, one of my methods trims the outline more aggressively, but in some cases it cuts portions out of the sprite body as well. This method also detached the top of the bow slightly.

I have another method that just selects the outer edge so that it doesn't trim inside the body, but it also misses all the "island" selections such as the area between the bow and the body, and between the subject's feet. On this sprite, it also misses the entire right hand side where the subject's elbow touches the right edge of the frame and its foot touches the bottom of the frame, effectively blocking the fuzzy selection from continuing to wrap around the subject's outer edge. This post isn't letting me attach the picture for some reason...

In all of the methods shown, you can see where the masks removed the small area between the satchel and the MOB's hip and of course the arrow is disjointed. I think these types of errors will have to be corrected by hand no matter what, so some other small post processing touch ups may not be a complete deal breaker.

Anyhow, none of these methods is proving to work perfectly in every situation which is making batching quite difficult. In this case, "Phredreeke's method undercut by 1 pixel" looks like it would be the easiest to clean up in post, but that may or may not be the case in every instance. I'll have to do more testing.
Last edited by MasonFace on Mon Mar 11, 2019 12:01 am, edited 1 time in total.

User avatar
MasonFace
Posts: 253
Joined: Tue Nov 27, 2018 7:28 pm
Contact:

Re: AI Upscaled Textures

Post by MasonFace » Sun Mar 10, 2019 6:17 pm

I've refined my method a little more and I'm now getting results similar to Phredreeke's; it's a little better in a few places, but has a few more jagged edges in other places and a little bit of black outline in some areas. Still not ideal...
21-3_Masonface3.png
21-3_Masonface3.png (86.17 KiB) Viewed 591 times
Last edited by MasonFace on Mon Mar 11, 2019 1:48 pm, edited 1 time in total.

phredreeke
Posts: 31
Joined: Mon Mar 11, 2019 9:13 am

Re: AI Upscaled Textures

Post by phredreeke » Mon Mar 11, 2019 9:57 am

Hi, I assume your interest is in the masks and not the pre-processed sprites?

I did tweak the mask script a bit and this is the result, while the outline is still there it is hopefully a bit more even now.

Image

A general word of advice is to expand the canvas prior to creating the mask, otherwise you risking part of the image "sticking" to the side of the frame.

I also feel that I should clarify that the masks themselves have not been created through any sort of neural network process.

Th3AustralianGam3r
Posts: 61
Joined: Mon Aug 21, 2017 6:37 am
Location: Australia

Re: AI Upscaled Textures

Post by Th3AustralianGam3r » Mon Mar 11, 2019 10:33 am

I have made a HD mouse pointer, i dont know the name to replace the original though.
Mouse Pointer Low Res.png
Mouse Pointer Low Res.png (3.06 KiB) Viewed 529 times
Mouse Pointer.png
Mouse Pointer.png (6.54 KiB) Viewed 529 times

User avatar
MasonFace
Posts: 253
Joined: Tue Nov 27, 2018 7:28 pm
Contact:

Re: AI Upscaled Textures

Post by MasonFace » Mon Mar 11, 2019 1:32 pm

Hi, I assume your interest is in the masks and not the pre-processed sprites?
Mr. Phredreeke himself! I want to thank you personally for your help up to this point. Your masking technique may prove be the best hope of getting this project moving towards completion. To answer your question, yes, I'm only having issues with obtaining a high resolution masking layer to restore the alpha channel after the upscale. Your latest result looks quite good! I'd prefer no visible outline, but as long as it is consistent as what's shown, I'm quite happy with it. :)
A general word of advice is to expand the canvas prior to creating the mask, otherwise you risking part of the image "sticking" to the side of the frame.
Yeah, I've learned that the hard way, lol. I probably should have expanded the canvas prior to upscaling, too. If you look on the previous page, you'll see that the top of the giant's head flattened after upscaling. :cry:
I also feel that I should clarify that the masks themselves have not been created through any sort of neural network process.
Yeah, I've been trying to understand how you went about it, but from your description of the process, I can't really infer much from how you upscaled the masking layer.
It's fairly automated, I put together a folder with images to be upscaled, this is then run through a number of scripts

1. creates a mask from the image in question
2. antialias the edges of the image, this is then fed to ESRGAN
3. the result of ESRGAN is run through a second script that sharpens, downscales and applies respective game's palette
4. finally, the mask from step 1 is applied to the downscaled image
Did you anti-alias the masking layer also? If so, how did you get sharp edges? Did you just increase the contrast?

User avatar
MasonFace
Posts: 253
Joined: Tue Nov 27, 2018 7:28 pm
Contact:

Re: AI Upscaled Textures

Post by MasonFace » Mon Mar 11, 2019 1:46 pm

Th3AustralianGam3r wrote:
Mon Mar 11, 2019 10:33 am
I have made a HD mouse pointer, i dont know the name to replace the original though.
Mouse Pointer Low Res.png
Mouse Pointer.png
Your new cursor looks great! But this thread is about using artificial intelligence to upscale the original graphics.

As far as where to put the new image file, I'm not sure but I'd suggest taking a look at this thread: viewtopic.php?f=27&t=1650&p=19654&hilit=cursor#p19654

Also, download Daggerfall Imaging 2 and see if you can find the original cursor (check maybe the IMG archive?). https://www.dfworkshop.net/downloads/da ... l-imaging/

Once you have the record name, then rename your image to match, then you may be able to drop it in your streaming assets folder (you will need a subfolder in there for the correct archive, "IMG" for example). I've only really dealt with textures, so I'm not nearly as familiar with injecting new UI assts.

Good luck!

phredreeke
Posts: 31
Joined: Mon Mar 11, 2019 9:13 am

Re: AI Upscaled Textures

Post by phredreeke » Tue Mar 12, 2019 12:33 am

I antialias the image, followed by upscaling to create the mask, at the end I apply a threshold effect of 127 to make the mask binary

BTW, could someone put together an archive with all the images that need masks in the same folder? Currently I have them in subfolders, so I can't just create a single batch to run through them all.

Post Reply