Calculating Size of Bitmap Image File

Started by
2 comments, last by clashie 14 years, 2 months ago
Hey I'm looking for an answer to why the size of 1 of my textures is smaller than the other. I have 2 different 256*256 24-bit bitmap textures. One of them is 192kb (this sounds right because (256*256*3) / 1024 = 192kb). But, the other texture is only 128kb. What is the reason for this? Edit: Something even weirder just happened. Maybe this is the doing of the OS? Anyway, I opened up the 128kb texture in paint, resaved it and it's now 256kb.
Advertisement
Most likely has to do with how the image is being compressed. I believe that in the BMP specification they do allow for the image to be compressed if a certain header value is set. Paint probably saved it uncompressed. Look up the BMP specification to check.
The 192 KB and 256 KB sound normal to me, but I don't know where the 128 KB is coming from. It may be compression, like klee1 said. But you're right the 192 KB is a straight 24-bit image with 3 bytes per pixel, while the 256 KB is 32-bits per pixel. I don't know why Paint would add in the unused fourth channel because I can't get Paint to do that on my machine.
Denzel Morris (@drdizzy) :: Software Engineer :: SkyTech Enterprises, Inc.
"When men are most sure and arrogant they are commonly most mistaken, giving views to passion without that proper deliberation which alone can secure them from the grossest absurdities." - David Hume
Quote:Original post by Halifax2
The 192 KB and 256 KB sound normal to me, but I don't know where the 128 KB is coming from. It may be compression, like klee1 said. But you're right the 192 KB is a straight 24-bit image with 3 bytes per pixel, while the 256 KB is 32-bits per pixel. I don't know why Paint would add in the unused fourth channel because I can't get Paint to do that on my machine.


Yeah, Paint doesn't ever save a 32 bit bitmap... it can't even load one if I remember right. It will also pad a 24 bit one if it doesn't end up aligning.

Checking the header should help figure out whatever mysteries are going on since it contains pretty much everything useful there is to know about the file.

This topic is closed to new replies.

Advertisement