Bit-mapped graphics
Bit-mapped graphics store every pixel necessary to represent an image.
Photographs are stored as bit-mapped graphics.
The term resolution is used to state the total number of pixels in an image.
Bit-mapped graphics are resolution dependent. This means that once an image is created its resolution is set.
Zooming in on a bit-mapped image makes it clearer that it is stored as individual pixels.
Each square in the above image is a pixel. The pixels are stored in a two-dimensional array and can be edited individually. The amount of colours that can be represented in a bit-mapped image is dictated by the bit depth.
| Bit depth | Available colours |
| 8 bits per pixel | 256 (28) |
| 16 bits per pixel | 65,536 (216) |
| 24 bits per pixel | 16,777,216 (224) |
| Bit depth | 8 bits per pixel |
|---|---|
| Available colours | 256 (28) |
| Bit depth | 16 bits per pixel |
|---|---|
| Available colours | 65,536 (216) |
| Bit depth | 24 bits per pixel |
|---|---|
| Available colours | 16,777,216 (224) |
The bit depth does not need to be one of those shown in the table.
A bit depth of 24 bits is known as true colour.
True colour allows for over 16 million different colours to be represented. This is called 'true' because it allows for detailed images within the range of colours and shades that the human eye can see. Here is the same image twice, once saved with a bit depth of 8 bits (256 available colours) and once with a bit depth of 1 bit (2 colours).
Compression
Compression is necessary for two reasons:
- to reduce the file size of an image so that it is less demanding in terms of storage and memory use
- to reduce the file size of an image to allow for faster transmission over a network
There are various forms of compression that can be used on bit-mapped graphics depending on the file format used. Two common techniques are:
- Run Length Encoding (RLE)
- Lempel, Ziv, Welch (LZW)
RLE
RLE is useful if a block of pixels in sequence are the same colour.
Example
An image of the sky has 18 consecutive pixels that are the same colour of blue. How many bits are needed to store this sequence?
Without compression
If the bit depth was set at 8 bits per pixel then it would take 144 bits (8 X 18) to store the sequence.
Using RLE compression
RLE would store the colour value once using 8 bits.
It would then store the number eighteen (for the 18 pixels) in binary – 00010010. This takes 8 bits.
In total 16 bits would be needed to represent all 18 pixels if RLE was used. This form of compression is excellent when an image contains large sequences of the same colour.
Here is another example of how RLE compression could be achieved:
Find a detailed explanation of run length encoding within the Media Types learner guide.
LZW
LZW compression will store patterns that are repeated. The pattern is stored in an index/look-up table.
When a pattern is repeated the index look-up table is referenced to create the sequence of pixels.
For example, if the pattern shown below were present eight times in an image it would be stored once in the look-up table and an algorithm would be used to call the pattern from the look-up table eight times.
To use the pattern again the computer would just need to store the binary value for the number 5 (00000101) as this is the index value used to store the pattern.
Find a detailed explanation of LZW compression within the Media Types learner guide.