[MOD][BETA] EE AI Denoised Areas
Leilu
Member Posts: 67
Hi,
I am looking into creating a mod with AI upscaled or at least denoised and blurless area images.
I am using NearInfinity to extract TIS/PVRZ files to PNG files.
The images are AI upscaled x4 and then downscaled back to the original resolution (as a starting point because I don't how to increase in-game resolution and if it's possible).
Download latest version
BGEE 279/329 areas 100% done. 50 remaining areas with "small animations" (mostly doors) to fix.
BG2EE 159/353 areas 100% done. 194 remaining areas with "small animations" (mostly doors) to fix.
Original
Denoised
Another example:
Original
Denoised
Speaking of the number of tiles, is it possible to change the number of tiles (it is set in the .WED referent file if I understand it well) to potentially increase the resolution of the images used by the game (provided I keep a multiple of 64) to further increase in-game quality?
Large area (right-click, open in a new tab to view full sized version):
Original
Denoised
300% zoomed (right-click, open in a new tab to view full sized version):
Original
Denoised
300% zoomed (right-click, open in a new tab to view full sized version):
Original
Denoised
Obviously, it's early tests. I think it will need some manual tweaks to bring back some grain with photoshop on some elements, but it won't be that tedious to do.
I could certainly be faster on the following ones with some automated tasks but it's going to be a lot of work. Probably 500+ hours for BGEE only, considering the number of areas.
Is it even worth it? Personally, I prefer this AI denoised render vs original render but it's true that for some surfaces, the loss of grain makes things a bit too smooth. The stone now looks like clay in some places. Wood also lacks grain.
And it's complicated to have a noticeable increase in quality while keeping the same resolution.
If only I could increase the in-game resolution by a factor of 2, it would really be worth the effort, I think. Why only X2? Because my X4 upscaled folder is 64GB diskspace. I think X2 will be the right spot between quality and disk space. It will be detailed enough to be able to zoom in at a usual playing distance without seeing any blur.
I need help from NearInfinity experts, but I don't want to disturb them either.
I have two (or three) big questions.
I share my actual work if you want to see the in-game result by yourself. It's only for BGEE for the moment.
I'm not used to Github at all, please bear with me.
SOD areas are untouched because I find them already sharp enough and without noticeable grain. Of course, I'll include SOD areas if I manage, with your help, to find a way to increase in-game areas resolution.
Thank you for reading
I am looking into creating a mod with AI upscaled or at least denoised and blurless area images.
I am using NearInfinity to extract TIS/PVRZ files to PNG files.
The images are AI upscaled x4 and then downscaled back to the original resolution (as a starting point because I don't how to increase in-game resolution and if it's possible).
Download latest version
BGEE 279/329 areas 100% done. 50 remaining areas with "small animations" (mostly doors) to fix.
BG2EE 159/353 areas 100% done. 194 remaining areas with "small animations" (mostly doors) to fix.
Original
Denoised
Another example:
Original
Denoised
Fixed! Shout-out to argent77I tried converting back my edited images to TIS files with the same number of tiles and putting these files in the override folder, but it doesn't work.
I can't get them back into the game without a black render or a crash. The tiling gets messed up in the process and I don't understand why.
Speaking of the number of tiles, is it possible to change the number of tiles (it is set in the .WED referent file if I understand it well) to potentially increase the resolution of the images used by the game (provided I keep a multiple of 64) to further increase in-game quality?
Large area (right-click, open in a new tab to view full sized version):
Original
Denoised
300% zoomed (right-click, open in a new tab to view full sized version):
Original
Denoised
300% zoomed (right-click, open in a new tab to view full sized version):
Original
Denoised
Obviously, it's early tests. I think it will need some manual tweaks to bring back some grain with photoshop on some elements, but it won't be that tedious to do.
100% fixed for static areas.The result is kinda nice but as expected I must work on the TIS files instead. At PVRZ file level I get visible tile borders unfortunately (look for horizontal and vertical lines). Animated tiles like fireplaces are really noticeable.
right-click, open in a new tab to notice tilling lines
A solution to avoid this issue of visible tiles would be to start by reassembling all the tiles by hand to form one large area in a single image ready for upscale at that time and then re-cut as it was originally.
I hope I can find another solution to this because it won't take me one single night to do this.
Manual tilling is no fun at all.
It took me around 90-100 minutes to do manually only one area with an animated fireplace (I had to manage the tiles of both fireplaces six times in total so that the borders of these animated tiles could not be seen).
In game result (right-click, open in a new tab to view full sized version):
I could certainly be faster on the following ones with some automated tasks but it's going to be a lot of work. Probably 500+ hours for BGEE only, considering the number of areas.
Is it even worth it? Personally, I prefer this AI denoised render vs original render but it's true that for some surfaces, the loss of grain makes things a bit too smooth. The stone now looks like clay in some places. Wood also lacks grain.
And it's complicated to have a noticeable increase in quality while keeping the same resolution.
If only I could increase the in-game resolution by a factor of 2, it would really be worth the effort, I think. Why only X2? Because my X4 upscaled folder is 64GB diskspace. I think X2 will be the right spot between quality and disk space. It will be detailed enough to be able to zoom in at a usual playing distance without seeing any blur.
I need help from NearInfinity experts, but I don't want to disturb them either.
I have two (or three) big questions.
- Would it be possible to work at the TIS level to skip the extremely tedious manual tilling process I do at the PVRZ file level? This would leave me to reassemble only the areas that have animations. A hell of a lot of time saved.
- Would it be possible to control the tiling to increase the number of tiles per TIS file to increase the resolution of the in-game areas?
- (off topic) What I do for areas, would it be possible to do for characters to smooth their aliased edges while making them sharper? The number of frames doesn't matter because I can work on an unlimited number of files at a time, but I still need to be able to extract and re-import them easily.
I didn't really understand how the character sprites worked in the game. When I look at a particular character's BAM file, some frames are empty. My understanding is that the bright colors I see are masks to which the real colors are then applied.
I share my actual work if you want to see the in-game result by yourself. It's only for BGEE for the moment.
I'm not used to Github at all, please bear with me.
SOD areas are untouched because I find them already sharp enough and without noticeable grain. Of course, I'll include SOD areas if I manage, with your help, to find a way to increase in-game areas resolution.
Thank you for reading
Post edited by Leilu on
0
Comments
GitHub - WillScarlettOhara/BG2EE_AI_Denoised_Areas...
Mod for Baldur's Gate 2 EE that increases the quality of the game areas - WillScarlettOhara/BG2EE_AI_Denoised_Areas
I have excluded the most recent areas from the EE version which do not benefit so much from this treatment, at least at this default resolution. Hexxat quest tomb for example.
New issue in BG2EE compared to BGEE, some water tiles are extremely visible like here for example:
I haven't tried to find out where this problem comes from, but surely by excluding some images with only water, I could correct it. I still have to find out which images correspond to these ugly tiles.
And maybe it's just a flaw that will correct itself when I have time to treat each area in full one by one.
@argent77 Sorry to ping you but it would help me a lot to have answers to my few questions from my previous post and I think that you are certainly the best placed to answer them. Thank you.
Converting to DXT1!
When you talk about aliased edges, are you only talking about the ones in the Athkatla temple district example or are you implying that the DTX1 format will also solve the vertical and horizontal lines problem visible in my first post examples?
(e.g.)
I'm going to have to manually fix this and if I can't work with the assembled images at the TIS level, it's going to take a long, long time.
The visible lines are more likely an issue of your upscaling procedure. I take it you upscaled pvrz textures individually?
In that case edges wont really fit together since the scaler is unable to take information from adjacent textures into account. I think that can only be solved in a satifactory manner by exporting the tileset as a whole, performing the upscaling, and then manually dividing the tile blocks based on the original pvrz texture layout.
Same number of tiles as original TIS file and TIS version PVRZ-based.
But it doesn't work the way I thought it would.
As I said in the first post, when I put newly created TIS and PVRZ files in override, I get a black area.
Yes, I knew from the beginning that by working on cut images to upscale them, I would have visible problems when the game will put them together. This is normal because the upscale software can't guess to treat the edges of the tiles correctly as if they were all assembled.
I want to export the tileset as a whole and I think best file for this is TIS file which is already a whole tileset. The problem is that I can't understand how the game and nearinfinity handle the image to TIS conversion to match the default game tilling and file structure.
Same for the created PVRZ file:
Will I have to manually divide the tile blocks based on the original layout of the pvrz texture like I did with the Beregost forge example in first post?
The game itself maps each tile individually in the associated WED file. But that's not a problem, since the regular map can be easily converted to a coherent graphics file with the right map dimensions. Extra tiles (such as opened/closed states of doors or water overlays) have to be processed separately though.
Processing the whole tileset should work, but because the game renderer itself is somewhat buggy you have to be careful when the upscaled image sources are converted back to tilesets later on without creating annoying lines in the game.
It might work if you first create palette-based tilesets from your processed image sources (via Tools > Convert > Image to TIS) and then use NI to manually convert them into the pvrz-based variant. If done from the TIS resource view (button Export... > as PVRZ-based TIS) NI will attempt to reduce the line artifacts to a minimum by taking WED file information into account. It would still be a time-consuming task though.
Are you sure the Tools > Convert > Image to TIS tool is working as intended? It looks like only the first row is saved no matter what (legacy or pvrz-based TIS version tested).
The result I get on the screenshot on my previous post when I browse the new TIS file in NI and his abnormally low file size tells me that. 378Ko for the 960x768px PNG file, only 78Ko for the converted TIS file. Data is clearly lost during conversion to TIS file.
That's working now thanks.
Edit:
Nice!
I still have to work on all the areas where there are small tiles and animations (like here at fireplace) but it will already be much less time consuming than what I intended to do with manual tilling in photoshop for every area.
Thank you very much.
No, it's not. The number of tiles does not always match the source image size (usually because the last row of tiles isn't filled completely), so you have to adjust it individually for each conversion.
This should fix all horizontal and vertical line problems except for doors, fireplaces, water and all other animated tiles. All this will be fixed slowly but surely.
Release BGEE AI Denoised Areas v220419 · WillScar...
BGEE AI Denoised Areas Fixed major visible tile edge issues Consider all areas without water or animations (e.g. fireplaces, doors ...
fixed to
I would like to make a weidu mod of it in order to make the installation but especially the uninstallation less prone to error. It can be difficult to know which files to delete in the override folder when you have a lot of other mods installed.
The problem is that I don't understand anything about weidu.
I wrote a custom installer for this mod:
BGEE
BG2EE
The installer and mod files are currently in a forked Github repository, send me a message if you want them to be stored differently / elsewhere.
It's ok for me.
If you could just put "WillScarlettOhara's" somewhere in your exe as a token of appreciation for the work done please.
BG2EE 100% done on areas without doors, fireplaces, water, flags or any animation tiles.
Download BG2EE AI Denoised Areas v220419
Of course, I'll update the executable soon. Thanks for the great work!
Nice ty. Do you plan to integrate an uninstaller? I think this would be the biggest added value of such a program: to be able to delete only the right files from the override folder without the risk of deleting wrong files from other installed mods.
BGEE AI Denoised Areas updated to v220420
I forgot one area.
Download
Thankee for sharing these mods!
Are all the backgrounds now denoised?
Is the BG1EE version EET compatible? (I assume so, but wish to ask here.)
Greetings again!
At least for your BG2EE denoised areas, it seems easy to add EET compatibility. Change "REQUIRE_PREDICATE GAME_IS ~bg2ee~ @1003" to "REQUIRE_PREDICATE GAME_IS ~bg2ee eet~ @1003".
For BG1EE (non-SoD) denoised areas, any map name the normally starts with "AR" like "AR1000" instead starts with BG when playing on EET. Thus, AR1000 on BG1 becomes BG1000 on EET.
There may be more involved in converting these files, but this is at least a good start.
Thankee!
After testing it, installing BGEE Denoised Areas on EET scrambles the graphics for the BG2 areas due to the reasons in my previous post. They are VERY not compatible!
BG2EE Denoised Areas on EET with the aforementioned slight .TP2 edit (adding eet beside bg2ee) worked.
Thankee!
Thank you Leilu!
How do we get these updated files for EET?
Thankee!