What is the size of indexed image of 512*512 with 256 color values?

If I have an image of resolutin of 512 * 512,
and this image is indexed with 256 color values,
how to calulate the size of the image (file size ) ?

0

1 Answer

The image itself can be calculate as follow

256 can be stored in one byte. So one pixel is 1 byte.

You have a 512*512 pixels.

512*512*1 = 262144 But on your disk, it will take a little more than those 262ko, as you have to count the bytes used for the file meta-information, and the color palette.

Check out the bmp header spec if you need more informations.

4

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like