Bitmap Images

Bitmap images are composed of tiny dots known as pixels, similar to a mosaic pattern. The majority of images, such as digital photographs, are bitmap images.

Digital photos function by sampling the real world, capturing its details in digital format. Bitmap images possess finite quality, which means it is not possible to continually zoom into them while retaining quality.

When capturing the real world in a bitmap image, the amount of data recorded and stored significantly influences the quality of the image.

Factors that affect the file size and quality of an image include:

  • Width - measured in pixels
  • Height - measured in pixels
  • Colour depth - measured in bits

Colour Depth

Each pixel in a bitmapimage is represented by a binary number. The number of individual bits affects how many possible colours can be shown, where the unique combinations of bits is the number of colours that can be represented.

If an image which stores 1 bit per pixel and only show 2 colours, with there being 2 possible values that can be stored with 1 bit (1 or 0).

If we double the number of bits stored per pixel (2 bits per pixel) we can now represent 4 different colours because there are 4 unique combinations we can make with 2 bits (00, 01, 10, 11)

The more bits that we used to represent each pixel increases the number of colours we can represent, however this also increases the size of the bitmap image file. Using the above examples while the second image of a tree is more realistic due to the number of colours we can represent we have doubled the number of bits that it takes to store the image (25 bits vs 50 bits).

When storing a bitmap image the raw values for each pixel is stored as a continuous string. The above 2 bit example would be stored as the following:

00001000000010101000001010100000001100000101110101

Meta data would also be added such as width, height and colour depth to allow the computer to interpret the stream of binary digits to reproduce the image.

Calculating File Size

When calcualting the file size of a raw bitmap image we can simply take the number of bits stored per pixel (colour depth) and multiply it by the number of pixels that make up the image. This is often done by using the following expression

bits = width(px) x height (px) x colour depth (bits)

You may need to convert the bits to another unit and we can do this by dividing the number of bits. The table below shows you what you would need to divide by to get to the desired unit for both OCR and Edexcel GCSE Specification. Remember for each step down the table you have to carry out all of the division up to that point.

Unit Edexcel OCR
Bit - -
Byte /8 /8
Kibibyte / Kilobyte /1024 /1000
Mebibyte / Megabyte /1024 /1000
Gibibyte / Gigabyte /1024 /1000

For example, if you have an image which is 50px wide, 60px height and has a colour depth of 4 and we need the file size to be represented in Kibibytes / Kilobytes:

OCR

Bits - 50 x 60 x 4 = 12000 bits

Kilobytes - 12000 / 8 / 1000 = 1.5

Edexcel

Bits - 50 x 60 x 4 = 12000 bits

Kibibytes - 12000 / 8 / 1024 = 1.46

Remember on the Edexcel specification you do not need to carry out the expression.

Metadata

Metadata is a term used throughout computing and is not exclusive to images.

Metadata is additional data attached to a file to help describe itself (metadata literally means data about itself).

With images we need metadata to help construct the image by providing a width, height and colour depth. We can also store data on the camera model an image was taken with, data / time and the location a photo was taken.

Metadata does increase the file size of a bitmap image, however usually compared to the rest of the image this size increase is minimal