AI Upscaled Textures

Show off your mod creations or just a work in progress.
Post Reply
User avatar
BadLuckBurt
Posts: 948
Joined: Sun Nov 05, 2017 8:30 pm

Re: AI Upscaled Textures

Post by BadLuckBurt »

King of Worms wrote: Thu Mar 05, 2020 1:04 pm
BadLuckBurt wrote: Thu Mar 05, 2020 11:51 am I dont know about algos but in case there is none the black could be removed using Imagick on a command-line maybe?
Thats I guess how adrinus did it... he deffo did not do it by hand. Any idea on how that command line should look like tho?
PS: my AI upscaling is up and running, uff, had to deal with issues I had not even a slightest idea on what they are about or what they mean but I managed :D
Nice!

I dont know the exact command line but this seems close to what we want:

https://www.imagemagick.org/discourse-s ... hp?t=32555

Just change the rgba value in those examples from 0.5 to 0.0

If it doesnt work I will check it out once Im home :)
DFU on UESP: https://en.uesp.net/w/index.php?title=T ... fall_Unity
DFU Nexus Mods: https://www.nexusmods.com/daggerfallunity
My github repositories with mostly DFU related stuff: https://github.com/BadLuckBurt

.

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

Re: AI Upscaled Textures

Post by King of Worms »

Hm so I have found out I copy the script in the CMD line but I still dont really understand how to make the script process whole directory full of images? I was unable to get any results.. even with a single image :D

Here is are 9 random images I took out of the lot, maybe u can try removing the black please? I chose the ebony chain mail, that will show us if it removes only the correct type of black.

Thanks a lot for helping me ;)

PS: lets say to ease up the transition of the script from PC to PC we will use the folder "C:/img" to place the images for processing.
Example.rar
(900.57 KiB) Downloaded 84 times

User avatar
BadLuckBurt
Posts: 948
Joined: Sun Nov 05, 2017 8:30 pm

Re: AI Upscaled Textures

Post by BadLuckBurt »

King of Worms wrote: Thu Mar 05, 2020 4:16 pm Hm so I have found out I copy the script in the CMD line but I still dont really understand how to make the script process whole directory full of images? I was unable to get any results.. even with a single image :D

Here is are 9 random images I took out of the lot, maybe u can try removing the black please? I chose the ebony chain mail, that will show us if it removes only the correct type of black.

Thanks a lot for helping me ;)

PS: lets say to ease up the transition of the script from PC to PC we will use the folder "C:/img" to place the images for processing.

Example.rar
No worries :) I'm home now so I'll give it a shot. You'll need a batch file to process in bulk, I'll set it up for you. I'll see if we can keep the paths relative, that way you should be able to run it from any folder you want. I'll install ImageMagick and report back when I have it working, shouldn't take long.

I've also changed the console command to log all created clothes - colour combinations, I just have to build DFU and then I can test this but I'll see about this thing first.
DFU on UESP: https://en.uesp.net/w/index.php?title=T ... fall_Unity
DFU Nexus Mods: https://www.nexusmods.com/daggerfallunity
My github repositories with mostly DFU related stuff: https://github.com/BadLuckBurt

.

User avatar
MasonFace
Posts: 543
Joined: Tue Nov 27, 2018 7:28 pm
Location: Tennessee, USA
Contact:

Re: AI Upscaled Textures

Post by MasonFace »

King of Worms wrote: Thu Mar 05, 2020 11:40 am Guys, I think Ive heard there was some new algo, which can keep the alpha?
Nope, don't think so. I think the absence of an alpha channel is a hard limit of the ESRGAN algorithm itself, and not of the models.

If you guys aren't able to get good results, I wouldn't mind taking a stab at it. I might could try to do what I did for the MOBs, but it would take me several weeks to upscale with various models to get good results, then good upscales to use for masking, then re-write all the GIMP scripts to restore the alpha... it would take a lot of effort and I don't want to get my hands dirty if anyone else can find a suitable alternative...

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

Re: AI Upscaled Textures

Post by King of Worms »

Thank you BadLuck :)

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

Re: AI Upscaled Textures

Post by King of Worms »

Hi MasonFace :)

thanks for the info!

I did the upscales using Lady algo, it gave me by far the best overall results around the clock. Nothing extra fancy but it will do the trick nicely.

I just cant decide which version I produced is better - the one with Waifu pre-processing or the one without.

I think I will test both, but the one without pre-processing appears more defined on avarage. Contrary to that waifu pre-process smooths things out nicely, but maybe a bit too much so the images are loosing detail. I tend to like the no-preprocess results better

I hope we can get rid of the black background in some sensible manner!

User avatar
BadLuckBurt
Posts: 948
Joined: Sun Nov 05, 2017 8:30 pm

Re: AI Upscaled Textures

Post by BadLuckBurt »

@KoW, one issue here that the black in the images you gave me isn't always black. If you move over the black areas with a color picker, you'll see some pixels are a very dark grey.

Is there any way to force anything that was transparent to a fixed colour during the upscaling process? Preferably something like Magenta (#FF00FF or rgb(255,0,255)).

ImageMagick does allow for a fuzz factor so it'll replace colours close to black to be transparent but that may yield unwanted results with very dark sprites, I'd prefer a solid colour that we can target if possible.

Note, this is just working out some kinks because the replacing itself seems to work fine:
Spoiler!
Image

Image

Image
DFU on UESP: https://en.uesp.net/w/index.php?title=T ... fall_Unity
DFU Nexus Mods: https://www.nexusmods.com/daggerfallunity
My github repositories with mostly DFU related stuff: https://github.com/BadLuckBurt

.

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

Re: AI Upscaled Textures

Post by King of Worms »

I think that would require to change the alpha in the original low res art to a fixed color background. And THEN do the AI upscale.

Is that something you can script in the prog?

Here are some low res images with dark color to test in case its possible.
ExportedTextures~.rar
(15.33 KiB) Downloaded 89 times

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

Re: AI Upscaled Textures

Post by King of Worms »

It seems tho, that even the solid background gets distorted :X
This is a result after switching alpha to a solid color, than do the AI pass
But maybe this color is better overall and will not mess with the results as much, because its not used in the images?
248_36-0_Elven.png
248_36-0_Elven.png (142.78 KiB) Viewed 1213 times

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

Re: AI Upscaled Textures

Post by King of Worms »

Found the way to add magenta to backgrounds automatically, processing, than will do the AI upscale and send a results

Post Reply