Can read in the BMP data correctly ,but the size is not right?

MRAB python at mrabarnett.plus.com
Mon Apr 29 14:10:59 EDT 2013


On 29/04/2013 18:20, Jimmie He wrote:
> I'm trying to read in the BMP data by the the code below,and I'm
> check the data array with WINHEX,and it is correct,but which confuse
> me is why the size is 0x180,but the actual picture should be 48*48 =
> 0x120 bytes because I use 1-bit BMP not the 24bit BMP,could any one
> give some hints?
>
[snip]
What size is 0x180?

If you're asking why the file size is 0x180 and not 0x120, it's simply
because of the header. An image file contains not just the pixels of
the image, but also information about the image.



More information about the Python-list mailing list