Representing images
Images also need to be converted into binaryA number system that contains two symbols, 0 and 1. Also known as base 2. in order for a computer to process them so that they can be seen on our screen. Digital images are made up of pixelPicture element - a single dot of colour in a digital bitmap image or on a computer screen.. Each pixel in an image is made up of binary numbers.
If we say that 1 is black (or on) and 0 is white (or off), then a simple black and white picture can be created using binary.
To create the picture, a grid can be set out and the squares coloured (1 – black and 0 – white). But before the grid can be created, the size of the grid needs be known. This data is called metadataData about data, eg photo image files have data about where the photo was taken and which camera took the picture. and computers need metadata to know the size of an image. If the metadata for the image to be created is 10x10, this means the picture will be 10 pixels across and 10 pixels down.
This example shows an image created in this way:
Adding colour
The system described so far is fine for black and white images, but most images need to use colours as well. Instead of using just 0 and 1, using four possible numbers will allow an image to use four colours. In binary this can be represented using two bitThe smallest unit of data in computing represented by a 1 in binary. per pixel:
- 00 – white
- 01 – blue
- 10 – green
- 11 – red
While this is still not a very large range of colours, adding another binary digit will double the number of colours that are available:
- 1 bit per pixel (0 or 1): two possible colours
- 2 bits per pixel (00 to 11): four possible colours
- 3 bits per pixel (000 to 111): eight possible colours
- 4 bits per pixel (0000 – 1111): 16 possible colours
- …
- 16 bits per pixel (0000 0000 0000 0000 – 1111 1111 1111 1111): over 65 000 possible colours
The number of bits used to store each pixel is called the colour depthThe amount of bits available for colours in an image.. Images with more colours need more pixels to store each available colour. This means that images that use lots of colours are stored in larger files.
Image quality
Image quality is affected by the resolutionThe fineness of detail that can be seen in an image - the higher the resolution of an image, the more detail it holds. In computing terms, resolution is measured in dots per inch (dpi). of the image. The resolution of an image is a way of describing how tightly packed the pixels are.
In a low-resolution image, the pixels are larger so fewer are needed to fill the space. This results in images that look blocky or pixelated. An image with a high resolution has more pixels, so it looks a lot better when you zoom in or stretch it. The downside of having more pixels is that the file size will be bigger.