View Full Version : 32 bit Bitmaps
Fyron
March 5th, 2010, 12:39 PM
What purpose, exactly, does a 32 bit Bitmap file serve? There are only 24 possible bits of color in the format (8 each of RGB).. Is there some weird CMYK bitmap format that is commonly created with the same .bmp extension?
Arralen
March 6th, 2010, 08:10 AM
An alpha channel (for transparency) may be stored in a separate file, where it is similar to a grayscale image, or in a fourth channel that converts 24-bit images to 32 bits per pixel. en.wikipedia.org : BMP_file_format (http://en.wikipedia.org/wiki/BMP_file_format)
Fyron
March 7th, 2010, 12:24 AM
I know of Microsoft's DIB insanity... but does anyone else actually use 32 bit bitmaps in the real world?
Baron Munchausen
March 7th, 2010, 09:54 PM
32-bit is not about the color. It's about the data format. Computers us binary math, remember. ;) Doing any sort of calculation in powers of two is much, much faster for a computer than working in other numeric system. So 32-bit images are faster for computers to handle than 24-bit images. The colors are the same.
Fyron
March 8th, 2010, 01:12 PM
That sounds like premature optimization to me.
Zero-padding the raw data is surely going to increase load times by increasing I/O operations to load from disk. The shift operations necessary to extract the proper parts of each 32 or 64 bit chunk of raw data to get the color values for each pixel are orders of magnitude faster than reading 33% more data from disk.
Once the data is loaded, it will be stored in program memory in exactly the same way, regardless of whether it has to be pieced together from multiple raw chunks or whether each raw chunk is one (or two on 64-bit cpus) full pixel.
vBulletin® v3.8.1, Copyright ©2000-2025, Jelsoft Enterprises Ltd.