Loading...
 

Bits and bytes (Image sizes)


bit (b)
One bit is the smallest unit of information. In a binary numerical system it is what you can represent with a one or a zero. (more).

byte (B)
Nowadays one byte is always 8 bits. Therefore, in a 16 bit image every PiXel intensity is represented by 2 bytes. (more).


The size of an image in bits (b) can be computed multiplying:

  • the total number of PiXels or VoXels in the image by
  • the number of bits per pixel by
  • the total number of channels

This number divided by 8 expresses the file size in bytes (B).

If you divide the size in bytes by 2^10> = 1024, you obtain the size in kilo-bytes (kB). If you divide it again by 1024 you obtain mega-bytes (MB).

Example


A Two Channel, 16 bit, 3D image that is 512 × 512 × 100 large will need

2 × 16 × 512 × 512 × 100 = 838860800 bits

of storage size only for the intensity values, plus some extra space if metadata exists describing the image. This is at least

838860800 bits / 8 = 104857600 bytes

or

104857600 / 1024 = 102400 kB

or

102400 / 1024 = 100 MB