LoadBMP icon indicating copy to clipboard operation
LoadBMP copied to clipboard

No support for alpha channel in the BMP file?

Open Planet-Patrick opened this issue 3 years ago • 2 comments

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.

Planet-Patrick avatar Apr 12 '21 00:04 Planet-Patrick

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.

vallentin avatar Apr 12 '21 07:04 vallentin

I ended up just using https://github.com/lvandeve/lodepng

Planet-Patrick avatar Apr 13 '21 04:04 Planet-Patrick