Page 1 of 1

plt to colored tga?

Posted: Wed May 06, 2009 8:16 pm
by Izk The Mad
Can anyone recommend a method/utility to convert .plt's to NWN palette colored .tga's? I've been wanting to do this for some time, so I can make some custom NPC models that don't use dynamic parts. I noticed an option in NWNexplorer 162, but it's greyed out. It does at least export the plt's as separate layer tga's, which I can color as Photoshop layers, but it would be a lot easier if I could have it done for me. Any thoughts? I did search around a bit, with no success. Thanks in advance. -Izk

Posted: Thu May 07, 2009 2:08 pm
by Estelindis
The easiest way I've found is to use Acaos's modified NWN explorer (as it utilises the full range of 1.66 colours) to look at the PLT file, choose colours for each layer - see here:
Image
and press Print Screen. Have a nice, blank image ready, which should be the exact same size as your PLT (512x512, most commonly) and paste the screen capture into that image. You'll need to move it around so that it's positioned correctly: just that texture showing, and none of the rest of your computer screen. Save the image as TGA. Then you can edit it further if you like (slight changes in the colour, make the skin seem a bit more decayed if you're doing a zombie or something).

Make sense? It works for me anyway.

Posted: Thu May 07, 2009 10:46 pm
by Izk The Mad
Thank you, thank you, Este! I always seem to miss the easy and obvious solution. My brain tends to overcomplicate things. :D

Posted: Fri May 08, 2009 12:07 am
by Estelindis
No problem, Izk! I love your overcomplications, as a rule. :D

The PLT texture format

Posted: Mon May 25, 2009 1:30 pm
by Estelindis
I posted this explanation of PLT images to sixesthrice some time ago, and I thought it might be a good idea to share it here too. :)

A PLT image is a greyscale image with ten layers. It is the type of texture used for dynamic clothing and body parts (i.e. the heads, armour, and body parts of PCs).

GREYSCALE (Skip this section if you want!)
The only thing that matters when you're working in shades of grey is the degree of brightness. (In addition to its position, the only information each pixel carries is its shade of grey. There's no red-green-blue, or hue-tone-saturation to worry about.) Basically, you're working with a gradient of greys between black at one end and white at the other. Keep this in mind!
Now, think of the NWN colour palette. Each "colour" in the palette is actually a gradient, starting with one colour, and moving through various other shades, until it reaches another colour. (Think of the palette in your mind. Each colour you look at, apart from pure black and pure white, has variation in it. If you actually extract the palette files and open them up in an image editor, you'll see the full gradients expanded, each one stretching in a long line of coloured pixels.) Now, every one of the colours in each of these continuums corresponds to a greyscale value: something on the gradient between black and white. NWN figures out which gradient value to use for each pixel of your texture based on what shade of grey it is in the PLT. Some gradients in the palette have more contrasts than others. So your one PLT is translated in a variety of different ways, depending on the palette values you choose. But, in itself, it is just one constant set of greyscale values.
So, if you make a very dark PLT, you'll find the colours look very different in NWN than if you make a light PLT. Overall, I find an image with a good range and some decent overall contrasts works best.
(Don't worry if this doesn't make sense right now. If you start with the other things, this will come to make sense eventually)

TEN LAYERS (This is kinda important)
Each of the ten layers corresponds to something that's tintable in NWN. Skin is the lowest layer, followed by hair, metal 1, metal 2, cloth 1, cloth 2, leather 1, leather 2, tattoo 1, all the way up to tattoo 2 at the top. (What this means is that, if you're working in (say) cloth 1, and you paste something down into cloth 1 which takes up the whole area of your image, it will fill all of cloth 1 *and* all of every layer below it - so now your lovely skin, and hair, and metals, are all covered in cloth.)
A layer can be empty - but it still has to be there. (A PLT just won't work if it doesn't have ten layers.) For instance, most armour has no tintable hair. But each PLT still has a hair layer. There's just nothing in it.
Every pixel in a PLT is used - but each pixel is only used by *one* layer and no less than one layer. If you leave a pixel used by no layers, and you save it, you'll notice it's filled in with black when you next open the image. If you leave a pixel used by more than one layer, the higher layer "wins out" and overwrites any lower layers. When you open your texture next time, there'll only be the higher layer's texture in that pixel.

HOW TO EDIT PLT IMAGES (Your bread and butter.)
You'll need some tools. What I use is a combination of a couple of utilities.
Firstly, Justin's PLT Editor is really handy for some things. 1) Seeing quickly what's in each layer. This is because PLT Editor shows each layer as a colour that contrasts radically with all the others. Skin = grey, hair = very dark cyan, metal 1 = very dark magenta, metal 2 = very dark yellow, cloth 1 = red, cloth 2 = green, leather 1 = blue, leather 2 = yellow, tattoo 1 = bright magenta, tattoo 2 = bright cyan. 2) Swapping one layer to another - at the touch of a button. 3) Fine pixel-by-pixel layer changes - because you paint directly, rather than dragging a selection.
Secondly, the Gimp (a free image editor) with DLA's PLT Plug-in installed. This is what you'll use most. It show the image in true greyscale, so you get an idea of how it looks as a whole, without being distracted by the transitions between layers. And you can manipulate the image however you want within GIMP - make it darker or lighter, apply a cloth pattern, paste in a texture from another file - the possibilities are endless. (Whereas, with PLT Editor, all you can do is change from one layer to another - you can't affect the image in any other way.)
If you spend a while playing around with some PLT images using these programs, I'm pretty sure you'll become comfortable with them soon. Here are some web links to get you downloading! [There's a Photoshop plug-in floating around somewhere on the Vault, but since I don't use Photoshop I don't use that either.]

The Gimp - http://www.gimp.org/
PLT Gimp Plug-in by DLA - http://nwvault.ign.com/View.php?view=Ot ... ail&id=670
PLT Editor by Justin - http://nwvault.ign.com/View.php?view=Ot ... ail&id=407