Sign in to follow this  
Guest Tony_A

Alpha = colorkey

Recommended Posts

Hi all,I see in Imagetool under 'Alpha' that some standart 8-bit textures have a 'colorkey'. What is that and how can I achieve it? I know it's for showing e.g. fences transparent but when I load such a texture in PaintshopPro and modify it, then saving it again, this 'colorkey' is gone when loading the new texture into Imagetool.How do I get this 'colorkey' back into my new (also 8-bit) texture?Thanks in advance,Rainer

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Hi Rainier,The structure of an 8-bit bitmap is something like that:- header (I do not remember the size in bytes but it is a 2 figure number) with information about the file, pointer to a palette of colors, horizontal size of the bitmap (say M), vertical size of the bitmap (say N) and so on ...- palette of exactly 1024 bytes or colors (= 4 * 256) - M x N bytes (one for each pixel) representing pointers to the palette.Since a color is represented by 3 bytes, the palette of 256 colors could be represented by 768 bytes ( = 256 * 3). However, when the bitmap was definied, it was decided to alocate 4 bytes to each entry, because it is simpler to address locations that are "powers of 2".As far as I know, when PSP opens an 8-bit bitmap it ignores every 4th byte in the palette. And when saving it places a 0 in every 4th byte of the palette.Now FS interprets the 4th byte in each palette entry as a transparency level for that color. 0 means completely transparent and 255 means completely opaque. There is one minor exception to this: when ALL the 4th bytes are 0 (as in a bitmap created by PSP) FS considers the bitmap as full opaque and ImageTool will give you the report of "no alpha". On the contrary, if JUST one of the 4th bytes of the palette is different from 0, FS considers the bitmap as having an alpha channel (colorkey) and treats the 4th byte as transparency.When I have to edit a bitmap in PSP, I allways have to recreate the transparency map after finishing the edition. Goran: could you explain how we can avoid this? I use PSP_5.0.Regards, Luis

Share this post


Link to post
Share on other sites

If you edit via Bmp2000 then the palette transparency is preserved.It will also let you change the transparency values easily.

Share this post


Link to post
Share on other sites

Thanks to all who replied to my question.I've learned a lot again, Luis.Problem solved using the little transp.exe tool - thanks for the link, Tony!Hopefully this 8-bit transparency technology remains compatible to the next version of FS!Rainer

Share this post


Link to post
Share on other sites

Glad that I helped solve your problem Rainer. ALL CREDIT is due to the writer of this little program. I don't know how it works, I do know what it does. I have worked with Nova to produce some buildings with semi-transparent windows to simulate tinted glass and had all sorts of problems until I found this program. I can't find the original download to give credit where credit is due to the author. I usually keep all"Readme"s with my downloads but don't have one with Transp.exe.................If you have his name, post a thank-you to him....................Tony

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this