Qhimm.com Forums
Miscellaneous Forums => Gameplay => Topic started by: Fraggoso on 2019-07-10 13:22:14
-
As I wanted to improve on my FFIX and X/X-2 HD Remake Texture Mods, I searched for a way to preserve alpha channels within an image using ESRGAN and asked Xinntao (from the original ESRGAN Team) in one of the bug reports if there's a way to do so.
He tweaked the test.py script so that now we can also upscale and preserves alpha channels: https://pastebin.com/xUdTHff9 Sadly he never came back to the community on other questions, that's why I'm shouting help to you all. :)
Here goes my first two questions:
1. Would it be possible to tweak the alpha test.py so it can detect alpha in an image and preserve the alpha?
2. If no alpha is in the image then it should just skip the alpha scaling?
Right now if there's no alpha, the script will stop working and ask you to use the normal test.py that comes with ESRGAN which is a bit tedious to use.
On the other hand, I found a model that works wonder on dithered images which can be found quite a lot in PSX Games.
https://github.com/alsa64/AI-wiki/wiki/Model-Database
I made a quick comparison.
http://www.framecompare.com/image-compare/screenshotcomparison/21J1NNNU
The problem with this script is, that it sadly also eliminates alpha completely...
So here's my last question:
3. With a hopefully tweaked alpha py, I also would need to have this working with the dedither model
Every help is very much appreciated! :)
-
https://mega.nz/#!W591SaCI!XPT7QjQFPG6oy6I3-DOTFaGrq38xyzaBUfh_3mtwp_8
this test file preserves alpha; use with old esrgan version (new one is useless for the end user anyway it has no effect on quality so i advise against using it in general). Gonna warn you though doing alpha wiht esrgan is always relatively bad;
Also using https://github.com/ptrsuder/crop-upscale-merge tool handles alpha better than the test i posted you and the tool is pretty much perfect regarding esrgan (and regarding what it does) anyway so I suggest just using it in general; Just configure settings and it will automatically split alpha and merge after upscaling, and as a bonus it has a really nice GUI and makes using many different models in quick succession easy and quick (for ex dedither followed by whatever model you want).
-
Seems a great gui, do you have any binary file of it ?
-
https://github.com/ptrsuder/crop-upscale-merge/releases just dl the release, exe is inside inside.
-
My bad, haven't seens it ^^'
-
https://mega.nz/#!W591SaCI!XPT7QjQFPG6oy6I3-DOTFaGrq38xyzaBUfh_3mtwp_8
this test file preserves alpha; use with old esrgan version (new one is useless for the end user anyway it has no effect on quality so i advise against using it in general). Gonna warn you though doing alpha wiht esrgan is always relatively bad;
Also using https://github.com/ptrsuder/crop-upscale-merge tool handles alpha better than the test i posted you and the tool is pretty much perfect regarding esrgan (and regarding what it does) anyway so I suggest just using it in general; Just configure settings and it will automatically split alpha and merge after upscaling, and as a bonus it has a really nice GUI and makes using many different models in quick succession easy and quick (for ex dedither followed by whatever model you want).
I already tried Auto crop but it doesn't work with the dedither Modell.
The error log reads:
[10.07.2019 22:17:59] Traceback (most recent call last):
[10.07.2019 22:17:59] File "hackallimages.py", line 7, in <module>
[10.07.2019 22:17:59] import architecture as arch
[10.07.2019 22:17:59] ModuleNotFoundError: No module named 'architecture'
[10.07.2019 22:18:00] Error ocured during ESRGAN work!
If I run it normally or with Satsukis GUI, it works, but not with Auto crop, sadly. :/
-
because you are using new esrgan and as i mentioned already its not advised and has no benefit for the end user.
use this https://github.com/xinntao/ESRGAN/releases/tag/old-arch then auto should work.
cheers.
-
because you are using new esrgan and as i mentioned already its not advised and has no benefit for the end user.
use this https://github.com/xinntao/ESRGAN/releases/tag/old-arch then auto should work.
cheers.
Thanks, now at least it works with the models but still, alpha isn't preserved. :(
Afterwards all images within my LR folder are erased.
-
Settings like this (dont be scared youre not gonna get a quality loss despite the warning on preserve format):
(https://cdn.discordapp.com/attachments/579994489280528395/598804795591229440/crop-upscale-merge_2019-07-11_11-16-09.png)
(https://cdn.discordapp.com/attachments/579994489280528395/598804795805138955/crop-upscale-merge_2019-07-11_11-16-12.png)
then click run all steps (Output: default; Overwrite: Disable; make sure the "merged" folder exists so create it beforehand)
-
I really can't solve the problem...
It also doesn't seem to copy the tiles from one folder to another, if I copy the tiles afterwards to merged folder and hit merge they merge at last but still, without alpha it's useless...
Everytime I receive this error:
'D:\ESRGAN\LR' is cleared
All images within that folder than vanishes.
I'm too stupid I think! >_<
-
Youre killing me XD
Are you absolutely sure you have all settings exactly like I posted them (including using the run all steps button, and having overwrite disabled and output default on the first tab? Because I can guaranteee that it works, i just double checked and tried it again. Worked flawlessly X_X
*edit* im almost sure that you didint have the image in the LR folder and a copy of it in the "img" folder(create it in the esrgan root (doesnt have to be called img just thats what its called by defualt just check the paths section in the first image i posted in my previous reply for reference what im talking about) if you dont have it like you created "merged" in results if you didint have it). =)
(https://cdn.discordapp.com/attachments/579994489280528395/598900607180341248/2019-07-11_17-30-16.gif)
Fingers crossed :P
-
I'm so baffled as it works now without any problems! >_<
Thank you so much, Manakaiser! You made my day. :)
-
:)