Separating bitmap color channels?,
Members - Reputation: 103
Posted 15 November 2012 - 12:48 PM
Having these loaded into 3-channel (RGB) 24-bit bitmaps is very wasteful -- it uses 3x the memory it really needs to. Is there a way to load these in as single-channel bitmaps (1 byte per pixel) and then when they're drawn, have them use the desired color?
Alternatively, is there a way to use, say, just the red channel out of a source bitmap and then draw it to the screen in any desired color? My thought here is that I could get triple-duty out of a loaded bitmap, with separate 8-bit images loaded into each of the R, G and B channels -- and then when I want to use those bitmaps, I'd just use one of the channels as a source then draw it in the desired color. Again, this would save memory because three of these 8-bit bitmaps would fit into a 24-bit loaded bitmap. Is there a way to pull this off? Some of these bitmaps are pretty large and use a lot of memory and I'd like to reduce the memory footprint.
I hope this makes sense to you, and I'd appreciate some tips or suggestions. Thanks!