WizWom Posted July 25, 2006 Share Posted July 25, 2006 OK, right now, he's got up a hack to put a Bitmap header on these, which brings them in, but I got a completely blank red channel, a green channel which seems reasonable, and a blue channel with noise - obviously wrong. So, I think the solution is putting a BitMAPV4HEADER in, instead; this allow specifying the alpha channel as the last 8 bits, and then I gusss a 3-2-3 or 3-3-2 mask for the first eight bits. we'll have to explore the actual mapping anyway, a header should be somewhat different. I'm testing at the moment, I'll post more in a bit. Damnit, stupid header introduced so much crap it's not worth doing. Link to comment
igi Posted July 25, 2006 Share Posted July 25, 2006 I treat PLT files as greyscale images, and I ignore the 'intensity' byte. Probably wrong, but it seems to work (for now...). Link to comment
Avenger Posted July 26, 2006 Share Posted July 26, 2006 I believe gemrb has a perfect plt displayer (i didn't notice any discrepancy). We ignore intensity scales, but use 00/ff values. The colour values are full 8 bits each. Check out the pltimporter in gemrb. Link to comment
WizWom Posted July 31, 2006 Author Share Posted July 31, 2006 OK, definitive information of PLT file: 'PLT ' 'V1 ' 0x00000008 0x00000000 (long)width (long)height Followed by widthxheight byte pairs, left to right, bottom to top. (unsigned char)intensity - Intensity 0xFF is transparent (unsigned char)mapcolor Colors are mapped thusly: 00 Skin 01 Hair 02 Metal 03 leather 04 Metal 2 05 Clothes - minor 06 Clothes - major 07-7F shadow (all intensities same) 80-FF repeat The high bit seems to be an indicator, but I have not seen it used in a Bioware PLT, and it seems to make no difference. I made a very simple converter set: http://mysite.verizon.net/wizwom/PLT2BMP.exe http://mysite.verizon.net/wizwom/bmp2plt.exe they, frankly, need a bit more smarts :-) plt2bmp input.plt output.bmp bmp2plt input.bmp output.plt I create 24 bit color BMPs (which actually are BGR, bottom to top, but that's another story). Link to comment
WizWom Posted November 17, 2007 Author Share Posted November 17, 2007 Er, it's been over a year, and this information isn't reflected in the IESDP still. Link to comment
igi Posted March 29, 2008 Share Posted March 29, 2008 Although it's less than two years old, this information is now reflected in the local copy of the IESDP. Is there any standard on the colours mapped to each material (e.g. BAM workshop shows magenta shadows and turquoise transparency, IIRC)? I currently have: skin - grey hair - cyan metal - magenta leather 1- yellow metal 2 - red cloth - minor - green cloth - major - blue shadow - black transparent - white Link to comment
WizWom Posted March 30, 2008 Author Share Posted March 30, 2008 Well, I initially I mapped the colors in a simple manner; but as that did not match the BAM mapping used elsewhere, I put in a lookup table to map the colors the same way when I coded it. My mapping was: Cv[7+] = 0; //shadow (black) Cv[0] = 00BR; //skin (yellow) Cv[1] = 00G0; //hair (green) Cv[2] = 0B00; //metal (blue) Cv[3] = 0BGR; //metal 2 (white) Cv[4] = 000R; //leather (red) Cv[5] = 0BG0; //clothes 2 (purple) Cv[6] = 0B0R; //clothes 1 (cyan) I give each of the channels the same intensity, that of the pixel in the PLT file. I don't make any adjustment for the 0-254 intensity of the PLT vs. the 1-255 intensity of the BMP; so I end up making very dark nominally colored pixels the same as shadow. When converting back, I consider a pure white pixel as transparent, a pure black pixel shadow, and then take the most intense channel and the other channels if at least half that intensity, and use the average of the channels as the intensity. Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.