Versions Compared

Key

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

...

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"
.\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 want just rescale H down 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.

Then we reuse H, L and M for M, S, T.

the other sizes as above.

Portrait SizeUseOriginal SizeTGA Size4x SizeFile Used4x DDS SizeNotes
Huge (h)Chargen only really256x512385KB1024x2048H upscaled1.33MB
Large (l)Character sheet128x25697KB512x1024Upscaled H rescaled341 KBSizeable increase in quality
Medium (m)Top left portrait64x12825KB256x512Upscaled H rescaled85.4 KB4x the original size so should be good (and not too large)
Small (s)Sidebar portrait, conversations32x647KB128x256Upscaled H rescaled21.4 KB4x the original size so should be good (and not too large)
Tiny (t)Tab "see names" portrait16x322KB64x128Upscaled H rescaled5.47 KB4x the original size so should be good (and not too large)

...

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:

  • po_plc_rainbw_h - Placeable but has h and l versions
  • po_plc_bbl_sm_m - This one has ONLY the medium one for some reason
  • po_msc_ - several placeable ones not marked "po_plc_" for some reason
  • po_levelup - only file, used in the top right for levelup (Equivalent I think to "m")
  • po_gi_x0horse_m - I think a placeable one, has only m/s/t
  • po_door01_m - placeable or door but not named po_plc_ so has only m/s/t
  • po_pause - solo file like levelup that has just the "m" sized variant
  • po_timestop - solo file like levelup that just has the "m" sized variant
  • po_unknownpc - Special solo fileNot sure if used...?
  • There's also a few default portrait files not prefixed po_ likely used in some cases

...

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!)

...