Converting Windows Bitmaps (.BMP)

When converting a 960x960x32 BMP file (32 BPP RGB with Alpha Channel) size to a smaller 192x192 BMP file using the built-in image converter, the bitness was also reduced from 32 to 24:

image

This has consequences for the transparency of the BMP image!

How do we preserve the 32-bit bitness and, thus, the image's transparency?

There was no transparency in the original.

Saved from Axialis iconWorkshop:

image

BMP has no alpha channel unless the software at both ends assumes that’s what the extra data is, which isn’t a valid assumption in general.

There’s no flag in the BMP format to say “the fourth channel is alpha”, and almost nothing will interpret the data that way. E.g. Load the image into Photoshop or just about any image viewer.

(Photoshop will load the 4th channel but won’t interpret it as transparency without you doing extra steps to convert the channel to that after loading. Most things just throw it away.)

You should be using PNG instead unless you’re doing something specialised where you’re feeding bitmap data into custom code or similar.

3 Likes