How much memory is needed to store a black and white photo with resolution 1024×512 if we use 32 gray levels?
ms c asked:
How much memory is needed to store a black and white photo with resolution 1024×512 if we use 32 gray levels?
How much memory is needed to store a black and white photo with resolution 1024×512 if we use 32 gray levels?


There are several answers to this question depending on what you are doing:
With no compression (like a bitmap):
1024 x 512 x 8 bits = 410 k or so, I assume a few bits for brightness
If you use compression then it depends on the type and agressiveness and whether it is lossy. Wild guess at a typical JPEG would be 40 k, really depends on complexity of picture and how much lossy you can tolerate
32 gray levels takes 5 bits.
5 bits x 1024 x 512 = 2621440 bits
2621440 bits / 8 = 327680 bytes
in real life you would use a byte per pixel and waste the 3 bits, so then that is 1024 x 512 bytes or 524288 bytes.
.