LoadBMP
LoadBMP copied to clipboard
No support for alpha channel in the BMP file?
Looks like this thing can't properly load BMP files saved with an alpha channel. Looking at the code it looks indeed like that is not covered. Is it not part of the official spec or something? GIMP can, for example, save and load bitmaps in this format.
Yeah, you're correct, this implementation doesn't support alpha channels. It's a long time since I've used it myself, so I don't recall the exact reason. What I do recall is that, when I needed support for images with alpha, that I ended up using PNG files instead.
In that regard, I can highly suggest stb_image.h
. It supports PNG, BMP, and more formats. Though I don't know if it supports BMPs with alpha channels.
I ended up just using https://github.com/lvandeve/lodepng