Sign in to follow this  
X Abstract X

Calculating Size of Bitmap Image File

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this