Archived

This topic is now archived and is closed to further replies.

Twilight Terror

Getting Transparency in Bitmaps!

Recommended Posts

I have this nifty little 2d sprite engine, but I can''t seem to get transparency working at all. It uses .bmp file format, and I don''t want to use .tga for the sake of my users (that''ll use the software). So I need to keep it in the bmp range. I just need to know how to make the color black (#000000, 0,0,0, B L A C K, ) transparent. I''ve tried some stuff, but I guess I just can''t figure the right way to do it. I got one to work, but it made the rest of the image semi-transparent, which isn''t what I wanted, and I don''t want my users to have to go through the trouble of masking, so I just need the one black color transparent. Any ideas? - Twilight Terror of Syntesis

Share this post


Link to post
Share on other sites
NitroGL    122
Simple, just loop through the image, if the current R-G-B is 0-0-0, then set that bit in the alpha channel to black (transperent), other wise set it to white (solid).

I bleave Nate still has a color key demo on his site (http://nate.scuzzy.net)

Edited by - NitroGL on June 27, 2001 10:18:05 PM

Share this post


Link to post
Share on other sites
Okay, that color key is fine and dandy... but I need it in a bmp, not raw. Can you please help me out? :-P

I'm using the color key idea.


- Twilight Terror of Syntesis

Edited by - Twilight Terror on June 30, 2001 12:48:43 PM

Share this post


Link to post
Share on other sites