This section specifically means portraits in portraits.2da that are not tied to a particular creature appearance. Those are usually found with the creature themselves.

The base game ones will get a 4x upscale (or reuse the _H one as a lower sized one) and any new ones will be listed here.

portraits.txi

This file must be included and be blanked so that the mipmaps of DDS files on portraits doesn't ruin the quality at high resolutions and high scaling values (eg; x3 or x4). It otherwise takes some weird cross section of the file when resizing it or viewing them at distance.

Methodology

This is from the 4x project.

Crunch Options

All portraits won't have alpha so forcing -DTX1 on nwn_crunch is the key to lower file sizes.

New Approach

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

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

# 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"


# 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"
.\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"

Creatures

We just rescale H down to the other sizes as above.

Portrait SizeUseOriginal SizeTGA Size4x Size4x DDS SizeNotes
Huge (h)Chargen only really256x512385KB1024x20481.33MB
Large (l)Character sheet128x25697KB512x1024341 KBSizeable increase in quality
Medium (m)Top left portrait64x12825KB256x51285.4 KB4x the original size so should be good (and not too large)
Small (s)Sidebar portrait, conversations32x647KB128x25621.4 KB4x the original size so should be good (and not too large)
Tiny (t)Tab "see names" portrait16x322KB64x1285.47 KB4x the original size so should be good (and not too large)

For placeables since they lack H and L (mostly! there are 1 or 2 that have them, perhaps since the portraits are reused on creatures for some reason).

Portrait SizeOriginal Size4x Size4x Size4x DDS SizeOption to do
Medium (m)64x128 canvas; upper 64x100 used256x51225KB85.4 KBM upscaled
Small (s)32x64 canvas; upper 32x50 used128x2567KB21.4 KBM upscaled and rescaled
Tiny (t)16x32 canvas, upper 16x25 used64x1282KB5.47 KB

M upscaled and rescaled

Oddities for the different options below:

Can remove:

Original Portraits Upscaled

To follow. Need to pick out which ones are appearance.2da related.

New Portraits

To follow.

Naming convention would be: po_op_XXX_t.dds (where T would be the appropriate size ID) if a generic "thing" else follow race conventions for Dwarfs, Elves etc.. XXX can be 9 characters long. This is because of portraits.2da limitations (you are forced to use po_ as a prefix!)