What is the simplest way to extract and write raw RGB data to a file from BitMap?
What is the simple and fastest wa开发者_如何学Pythony to extract raw RGB data from a BITMAP and write the raw data to a file(say .rgb)?
A bitmap is already 'RAW' if it is 24-bit color. In that case, simply strip the BITMAPHEADER.
Yes, assuming its unpaletted 24 bit bmp, just strip the header and read the bytes in. IIRC you might also need to reverse the byte ordering too as when reading bitmaps from files byte for byte they come in as BGR.
精彩评论