开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜