- Fixing issues in previous test (crashes, buggy textures)
- Work out why nwn crunch doesn't convert everything anyway
- Categorise files and remove some from the process that don't need it / bug out
- Get tiled textures separated so the option in Cupscale can be used
- Desharpen filter from loinne
- PLT testing
- Need to write some python to have GIMP convert PLT's to PNG's with transparency then back from upscaled PNG files to a single PLT
Alpha Transparency Options in Cupscale
The default alpha mode is now 0 (ignore alpha). There are also now 3 other modes to choose from:
--alpha-mode 1: Fills the alpha channel with both white and black and extracts the difference from each result.
--alpha-mode 2: Upscales the alpha channel by itself, as a fake 3 channel image (The IEU way) then combines with result.
--alpha-mode 3: Shifts the channels so that it upscales the alpha channel along with other regular channels then combines with result.
The default is option 1 when Transparency is ticked.
Option 3 seems to work best for keeping the crisp edges of PLT's - see below. There is some oddities still regardless which might account for other transparency oddness.
The PLT file is a bit of a mess. They're essentially greyscale images but with each layer being recoloured by the game, or if a layer has nothing to colour it's blank/all alpha. Some notes:
- PLT files are basically a big TGA file. No compression here so no need to to de-DDS them
- PLT files have different areas coloured in differently. Since we're upscaling we need to retain the hard edges at 4x size. We could dither but that is going to be wayyy down the line (there are 1500 PLTs!). It still looks markedly improved if you upscale and have the hard but jagged edges.
- PLT files have 10 layers (!) when split using GIMP, crazy amounts of images to split even if 99% of them are all alpha.
Luckily Symmetric is a wizard and has done a GIMP plugin to load and save PLT's in GIMP directly, and was able to offer a script setup to GIMP over images.
I used PNG as the intermediate format. This was chosen for mainly ease of opening. The problem is the transparency option in Cupscale (using option 3 - see above) seems to still give the transparency layer of the PNG some "not wholly transparent" alpha numbers; from Symmetric; "Found the problem, the pngs aren't 100% transparent. Minimum is 1, should be 0 - that alone would be an easy fix. BUT there other values of about a 100 (50% opacity) in some pixels. Question is which layers should such a pixel belong to." - this means he altered his script to allow some level of alpha-ness.
This basically works but has some black edges creeping in - so will either have to try to create some kind of "copy alpha to the final image and override it" or something else to "clean up the alpha (where there are no real pixels)" perhaps. Merging in a PLT manually doesn't seem to work too well either in this regard, hmm...
|See the black edges around the red portion of the shoulder|