View Full Version : BIF colour 0(transparent)?
Anyone know what RGB numbers for the transparent colour for the bif palette?
The closest seems to be 0 128 0 but it doens't work unless I'm pasting it into an existing bif. The problem is that the rest of the colours I paste in don't fit the existing bif palette and colours end up being screwy.
On another note is there a name for the palette scheme that bif recognizes?(ie. pantone,tru match, windows etc) It seems some indexed colours are recognized and others aren't.
I use photoshop & windows xp paint editor with readbif 2.2b.
I tried using search to find the answer to this... no dice http://www.totalwar.org/forum/non-cgi/emoticons/frown.gif
Wellington
09-25-2003, 18:16
Within a BIF the first entry in the colour palette (entry 0) is always the transparency colour - which for MTW BIFs will be 0,128,0
The last entry in a BIF palette (entry 255) is NOT a colour but rather represents the colour mode - which determines how many bits are truncated for R/G/B in order to match the palette.
If you are using BIf reader to extract the frames as BMPs and then using photoshop to edit them before reimporting these edited BMP frames back into the BIF (via BIf reader), you will have some problems as photoshop (or windows paint) does'nt recognise the BIF palkette 'rules'.
Different people solve this problem in different ways. I solve it by having a small tool that always overwrite the 1st 2 bytes in a BIF with the correct palette colour (0,128,0) - however BIF colour palettes have only 2-byte entries.
The following info (from a post on another forum) may help understand this together with the BIF color mode -
Graphics formats that use 256 colour palettes always have a table that defines the RGBs being used. BMPs have 4-byte entries (B,G,R,null) whilst LBMs have 3 byte entries (R,G,B).
BIFs have only 2-byte entries (this is what has confused me for ages) - and the colour table is the first 512 bytes in the BIF.
Why only 2 bytes? Can't we use the full ranger of values (0-255) for each colour? NO We can't. Not in a BIF. We would need 3 bytes (24 bits) to represent all colours possible and a BIF only allows us 2 bytes (16 bits).
SO, in a bif each R/G/B colour used for the bif is truncated for the colour table. Instead of using all 8-bits the BIF uses -
- 1st 5 bits for R
- 1st 6 bits for G
- 1st 5 bits for B
... hence our 16 bits.
This is why, if you look at the RGB values in the any BIFs "color Table" , you will notice that the RGB values (for colour mode "FFFF") -
- R is ALWAYS a multiple of 8
- G is ALWAYS a multiple of 4
- B is ALWAYS a multiple of 8
It's bit different for colour mode "7FFF", buts thats another issue.
The implications are (for DJ) any colour he is using for creating the PCX's may change slightly. Not by much, and it probably won't be noticable, but any RGB that does'nt follow the above convention will have the colours changed slightly. For example, an original RGB (PCX or BMP) of 213/209/206 will end up as 208/212/200 in the BIF colour palette.
Welly
Ah... thanks Wellington things are so much clearer now http://www.totalwar.org/forum/non-cgi/emoticons/biggrin.gif
The RGB multiples helped a lot and I edited the first colour in the colour table to 0 128 0 in photoshop and it works.
vBulletin® v3.7.1, Copyright ©2000-2025, Jelsoft Enterprises Ltd.