Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

After some testing of the below (renaming some files, copying others) it is actually beneficial instead to use the mipmaps of the 4x option.

This will need likely some GIMP scripting but could be much simpler as well - you end up with a source _H PNG, then you generate the DDS of it, and from that DDS generate the 4 other files.

Gives each portrait a relatively optimal "size" but retains all the upscaling details that bring back quality.

Same can be done for the placeables just using the M instead of H.

Alternatively: Just use crunch rescale; see how that does - remember DXT1! Need a powershell script for this.

Edited - this is the new approach, just use crunch to generate all the sizes with the rescale option.

Code Block
languagepowershell
titleconvert_portraits.ps1
linenumberstrue
collapsetrue
# Make duplicates of the PNG files

# Find all files
$source = Get-ChildItem "in\*h.png" -Recurse

$itemcount = $source.count
$itempercent = $source.count*100
$progress = 0

foreach ($sourcefile in $source)
{
    # Progress bar
    $progress++
    Write-Progress -Activity "Copying _H files to the other sizes. Current item: $sourcefile" -Status "Progress: $progress of $itemcount" -PercentComplete (100 * $progress/$itemcount)

    
    # Get the source filename - needs a space at the start too
    $filename = Split-Path -Path $sourcefile -Leaf
    # Take off last letter
    $filename_short = $filename.substring(0, $filename.length - 5)

    $l_file = "in\" + $filename_short + "l.png"
    $m_file = "in\" + $filename_short + "m.png"
    $s_file = "in\" + $filename_short + "s.png"
    $t_file = "in\" + $filename_short + "t.png"

    # Copy to the other names
    If(!(Test-Path "$l_file")) { Copy-Item $sourcefile -Destination "$l_file" }
    If(!(Test-Path "$m_file")) { Copy-Item $sourcefile -Destination "$m_file" }
    If(!(Test-Path "$s_file")) { Copy-Item $sourcefile -Destination "$s_file" }
    If(!(Test-Path "$t_file")) { Copy-Item $sourcefile -Destination "$t_file" }
}

Write-Output "Generating _h DDS"
.\nwn_crunch.exe -file -i "in\*h.png" -outdir "out" -fileformat dds -DXT1 -yflip -quiet
Write-Output "Generating _l DDS"
.\nwn_crunch.exe -file -i "in\*l.png" -outdir "out" -fileformat dds -DXT1 -yflip -quiet -rescale 512 1024
Write-Output "Generating _m DDS"
.\nwn_crunch.exe -file -i "in\*m.png" -outdir "out" -fileformat dds -DXT1 -yflip -quiet -rescale 256 512
Write-Output "Generating _s DDS"
.\nwn_crunch.exe -file -i "in\*s.png" -outdir "out" -fileformat dds -DXT1 -yflip -quiet -rescale 128 256
Write-Output "Generating _t DDS"
.\nwn_crunch.exe -file -i "in\*t.png" -outdir "out" -fileformat dds -DXT1 -yflip -quiet -rescale 64 128

Write-Output "Done"


Code Block
languagepowershell
titleconvert_portrait_m_placeable.ps1
linenumberstrue
collapsetrue
# This is an awful way of doing things but hey, whatever
# Make duplicates of the PNG files

# Find all files
$source = Get-ChildItem "in\*m.png" -Recurse

$itemcount = $source.count
$itempercent = $source.count*100
$progress = 0

foreach ($sourcefile in $source)
{
    # Progress bar
    $progress++
    Write-Progress -Activity "Copying _m files to the other sizes. Current item: $sourcefile" -Status "Progress: $progress of $itemcount" -PercentComplete (100 * $progress/$itemcount)

    
    # Get the source filename - needs a space at the start too
    $filename = Split-Path -Path $sourcefile -Leaf
    # Take off last letter
    $filename_short = $filename.substring(0, $filename.length - 5)

    $s_file = "in\" + $filename_short + "s.png"
    $t_file = "in\" + $filename_short + "t.png"

    # Copy to the other names
    If(!(Test-Path "$s_file")) { Copy-Item $sourcefile -Destination "$s_file" }
    If(!(Test-Path "$t_file")) { Copy-Item $sourcefile -Destination "$t_file" }
}

Write-Output "Generating _m DDS"
.\
Code Block
nwn_crunch.exe -file -i "in\*m..\sources\*hpng" -outdir "out" -fileformat dds -DXT1 -yflip -quiet -rescale 256 512
Write-Output "Generating _s DDS"
.\nwn_crunch.exe -file -i "in\*s.png" -outdir "out" -fileformat dds -DXT1 -yflip -quiet -rescale 128 256
Write-Output "Generating _t DDS"
.\nwn_crunch.exe -file -i "in\*t.png" -outdir "out" -fileformat dds -DXT1 -yflip -quiet -rescale 64 128

Write-Output "Done"

Creatures

We want to upscale the Huge portrait which is highest quality option available to be the new Huge. Then we cut this one in half for the Large.

...