Jump to content
  • Advertisement
Sign in to follow this  
beebs1

DevIL? (Bitmap with alpha channel)

This topic is 2389 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hiya,

I've saved a BMP in Photoshop with an alpha channel - I've double checked that I'm setting 'Save Alpha' and 32-bit (A8R8G8B).

When I load the image using DevIL and call ilGetInteger(IL_IMAGE_BPP), it returns 3 instead of 4.

Has anyone managed this before?

Thanks! :)

Share this post


Link to post
Share on other sites
Advertisement
The bitmap format doesn't support an alpha channel. Technically it's possible to create a 32-bit bitmap, and 32 is a documented valid value for the biBitCount member of BITMAPINFOHEADER, but (check your MSDN) the extra 8 bits are just ignored. You could in theory stash any data you like in there, but a program using the bitmap file would need to have code added to do something useful with it; it's perfectly legal for any program to just discard the data and a program doing so is still compliant with the bitmap format specification.

So I'm guessing that something somewhere in the chain is aware of this and is ripping out the extra bits. You're just going to need to use a different image format.

Share this post


Link to post
Share on other sites
Oh! Thanks for that!

I've built a colour key scheme instead, where I write the alpha component after loading the texture, depending on the rgb components.

Thanks again :)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!