Storing Images

Homepage

Storing images description

Bitmaps

Description:

  • A bitmap is a represntation of an image where each square represnts a pixel (picture elements).
  • The colour of each pixel is represented by a binary code
  • The number of colours available in an image depends on the number of bits each pixel has.

For example, a black and white image only uses 2 colours therefore, only needs 1 bit to represnt each pixel.

For Example:

1-Bit image

Images with 4 colours for example, will have 2 bits per pixel where each pixel can be one of 4 values:

  • 00
  • 01
  • 10
  • 11

For Example:

2-Bit image

You can increase the range of colours and shades by increasing the number of bits per pixel.

Colours

Colour Depth:

  • The colour depth is the number of bits used for each pixel.
  • Given the colour depth, you can calculate how many colours are used in an image using the formula:
  • Total number of colours = 2^n Where n = number of bits per pixel.

  • Most devices use 24-bit colour depth, this ensures that the device will cover all of the colours humans can possibly see.
  • This is because humans can see around 10,000,000 colours and 24-bit colour depth covers around 16,000,000 colours.

24-bit colour depth:

24- Bit colour depth

Image Resolution:

  • Image resolution is the number of pixels in an image.
  • To calculate image resolution: width X height of a bitmap.
  • The higher the image reolution indicates the that the image has more pixels so is better quality.

File Size

  • To calculate file size/ the number of bits an image will take up, the following formula is used:
  • File size = Image reolution (width X height) X Colour Depth.

  • Using a greater image resolution or colour depth will increase the file size but will increase the quality of the image.