AI Upscaled Textures

Show off your mod creations or just a work in progress.
Post Reply
phredreeke
Posts: 60
Joined: Mon Mar 11, 2019 9:13 am

Re: AI Upscaled Textures

Post by phredreeke » Mon Mar 25, 2019 3:17 pm

I tweaked the script to make a thinner mask. Here's the result for 457
Attachments
457-newmask-190325.zip
(251.74 KiB) Downloaded 23 times

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

Re: AI Upscaled Textures

Post by King of Worms » Mon Mar 25, 2019 7:45 pm

15 minutes a mob is not THAT bad, but I understand having a tea is a better and more sofisticated option. I remember just from a export from dfimaging to a final xbrz upscale with correct naming my method had like 6 various steps.. it was hell. Pure hell. I also had to rewrite scripts so many god damn times, because these mobs have different number of animation frames because they have different attackc and properties in general...

Just remembering it hurts my head now.

Fingers crossed for u to be able to automate it nicely, sip a tea and watch your HW produce some heat (instead of your head)

If u can endure it one way or another and come up with a complete DF mobs upscale of a quality shown around, neverending hall of modding fame and glory awaits you on the other side :twisted:

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

Re: AI Upscaled Textures

Post by MrFlibble » Tue Mar 26, 2019 10:29 am

MasonFace wrote:
Mon Mar 25, 2019 2:03 pm
@MrFlibble:

I gave your new method a try and can confirm that the results were better than the previous xBRZ softening method.

I applied the steps as below with the following caveats for GIMP 2.10:
  • Scaled up with xBR to 4x the original size
  • Applied gaussian blur with value of 0.50 (1.5 was WAY too strong with this version of GIMP, not sure why)
  • Scaled the image down 25% using cubic interpolation (GIMP 2.10 renamed it from "Bicubic" to just "Cubic")
  • Applied anti-alias. This didn't appear to do anything, but it may have just been too subtle to notice
  • Added HSV noise. This seemed to do the most good. Makes sense considering the images the models were trained on.
Please note that I apply GIMP antialiase and noise before scaling the image up with xBR.

Also I'm becoming concerned that the noise is completely random, so you get hit-and-miss results with image details and faces. So I tried to do something more uniform and used the GIMP Apply Canvas feature (default setting, depth of 2) after scaling up with xBR. Here's a small comparison. This time I used a different model, which is an alpha 0.5 interpolation of Random Art JPEG Friendly model (version 1) and Manga 109, which produces somewhat sharper results. (I mentioned this model before in this thread.)

There's also another thing that the way the sprite edges are processed is dependent on the colour of the background. I tried to darken the blue background for the sprites above and here's the result (with GIMP AA):
Image

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

Re: AI Upscaled Textures

Post by MasonFace » Tue Mar 26, 2019 2:12 pm

@MrFlibble:
Please note that I apply GIMP antialiase and noise before scaling the image up with xBR.
Noted. Thank you.
Also I'm becoming concerned that the noise is completely random, so you get hit-and-miss results with image details and faces.
Don't quote me on this, but I think the HSV Noise Filter in GIMP 2.10 has a check box to enable/disable the random seed. I'd have to take a look when I get home after work to know for sure. Alternatively, could you generate a noise pattern on an empty image and superimpose it over every image?

Your latest results look very promising, btw!

@Phredreeke:
I tweaked the script to make a thinner mask.
Would you mind re-processing the first batch of sprite outlines with your tweaked script?
475.png
475.png (74.07 KiB) Viewed 902 times
The ones I currently have are good, but your improved ones are phenomenal. The bear outline looks darn near perfect now.

I've got my composition script batched now, so I should be able to process all of the MOBs very quickly once I get the improved masks. :P If you want to just let it run overnight, I can certainly wait.

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

Re: AI Upscaled Textures

Post by MrFlibble » Tue Mar 26, 2019 4:52 pm

MasonFace wrote:
Tue Mar 26, 2019 2:12 pm
Don't quote me on this, but I think the HSV Noise Filter in GIMP 2.10 has a check box to enable/disable the random seed. I'd have to take a look when I get home after work to know for sure. Alternatively, could you generate a noise pattern on an empty image and superimpose it over every image?
I'm using v2.8.20 so I wouldn't know :)
MasonFace wrote:
Tue Mar 26, 2019 2:12 pm
Image
Out of curiosity I processed this frame using my method and noticed that the blue background from the Bethesda preview sprite set results in residual pixels even if Kuwahara-Nagao blur applied:
Image
So I decided to use a completely different background colour I picked from the default set in KolourPaint:
Image
This resulted in cleaner but jaggier edges (Random Art/Manga interpolation):
Image
UPD: I did another test with yet another colour:
Image
However this time I also applied Kuwahara-Nagao blur at 2 pixel radius instead of 1 (still with protect details on) to create the mask. I also copied the mask background over the original image (processed with ESRGAN/Manga 0.2 interpolation) with one pixel thick outline from the Kuwahara-Nagao version:
Image

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

Re: AI Upscaled Textures

Post by phredreeke » Wed Mar 27, 2019 1:28 am

Here are the masks for 256-380, I'll process more later http://s000.tinyupload.com/index.php?fi ... 9899564501

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

Re: AI Upscaled Textures

Post by MrFlibble » Wed Mar 27, 2019 9:49 am

Upscaled a sample of actor sprites against the blue background similar to the addendum of the previous post:
Spoiler!
Image
I'm now inclined to think that adding noise does not really improve the results, so I skipped this step.

Additionally I tried making the contrasts in the processed sprites less sharp while preserving detail by scaling the image up to 4x size with Sinc and then back down with Bicubic before applying GIMP antialiase. It seems to produce better results overall but worse on sprite egdes. So I scaled the image up with Sinc and then back to original size with Bicubic but then copied the background with one pixel thick sprite edges from the original unaltered image (thus removing the effect from edges only) and then applied antialiase as usual (comparison).

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

Re: AI Upscaled Textures

Post by MrFlibble » Wed Mar 27, 2019 4:22 pm

I processed a few more of the small NPC flats, surprisingly these produce somewhat better results regarding their faces:Image
This was done with the scaling up with Sinc and back down with Bicubic before applying antialias as described above.

I also gave a go at some medium flats for a test (same procedure as above):
Image
It's all pretty good save for the faces. The girl probably came out best out of the three, the innkeep got the typical unibrow but the guy on the left has got a cartoonish face altogether (kinda reminds me of Adventures of Tintin :)).

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

Re: AI Upscaled Textures

Post by phredreeke » Wed Mar 27, 2019 5:34 pm

Here are 380-511. http://s000.tinyupload.com/index.php?fi ... 7947287894

Will post the rest later

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

Re: AI Upscaled Textures

Post by MrFlibble » Wed Mar 27, 2019 6:02 pm

After further testing I realised that using xBRZ, after all, produced better results at sprite edges:
Image
(compare with the same group in the above post)

Additionally the resulting upscales are for some reason a bit sharper if xBRZ is used instead of xBR.

Post Reply