Learning Outcomes
• demonstrate understanding of how pixels are used in image representation;
• demonstrate understanding of how image resolution affects file size;
• describe how vector-based graphics and bitmap graphics are stored;
• describe the difference between vector-based and bitmap graphics; and
• demonstrate understanding of how buffering and streaming are used to support the transfer of moving image files.
The shape shown is supposed to be a circle, but the edges are PIXELATED instead of being smoothly curved. This is because this image is a bitmap and constructed from a grid of individually-coloured PIXELS. A PIXEL is the smallest unit of an image that can be changed. It is usually a square shape filled with just 1 colour, but it can be rectangular. The word pixel is a fusion of two words: “picture” and “element”.
It is the job of the screen in conjunction with the graphics card of a computer to display the pixels in their rightful colours (or the nearest available match). In order to store an image on a storage device:
• every pixel needs to have its colour code stored;
• metadata such as the dimensions of the image need to be stored in order to allow the image to be reconstructed for the screen display.
All digital data gets encoded and stored as binary numbers, and colours are no exception. In order to store the shape shown on page 1, we will need 3 binary colour codes: one for the pixels at the centre of the circle, one for the circumference of the circle and one colour code for the outer region. In general, when storing an image such as a photograph, we will need one colour code for every colour of pixel found in the photograph, and this number can be very high.
We could represent the image above using the binary codes 00 = black, 11 = white and 10 = grey. Here is a fragment of the image along with the binary patterns that would thus be used to represent the image in the computer’s memory:
There was the possibility of using a 4th colour, encoded as 01, but this image didn’t require it as only 3 colours were used. The 4th colour code is still available for use at a later stage. With N bits per pixel you can have 2N different colours. This is known as the COLOUR DEPTH. A GIF image uses 8 bits per pixel, thus it is limited to 28 colours, i.e. its colour depth is 256 colours. Using 24 bits is known as true colour as it offers an enormous 224 colours
Consider a bitmapped graphic. If:
• width = 1024 pixels
• height = 1536 pixels
...then the PIXEL COUNT is 1024 × 1536 = 1,572,864 pixels.
This is approximately 1.5 megapixels, which is written as 1.5 MP. However, not every pixel in the world is the same size. If we also know that those 1024 pixels measure 2 inches, then: 1024 ÷ 2 = 512 pixels per inch
The same conclusion can be derived from calculating 1536 ÷ 3 = 512 pixels per inch since pixels are squareshaped. “Pixels per inch” is usually abbreviated to “ppi”, and if centimetres are used it is referred to as “ppcm”. The number of pixels per unit of measurement (usually centimetres or inches) is known as the RESOLUTION of an image. It quantifies the clarity of the image on the screen/page.
A high-resolution image will fit a large number of pixels into a small space, enabling very clear and realistic images to be stored and viewed. However, this leads to larger file sizes, as every pixel’s colour code will have to be stored.
In turn, this leads to:
• higher overall image loading and processing times on computers;
• higher overall image file transfer times across communications links.
In the 6 square inch area shown in the diagram, at a resolution of 512ppi, there are 1.5MP to be stored. If the resolution were to be doubled to 1024ppi then twice as many pixels would be stored horizontally and twice as many would be stored vertically, so the file size would quadruple. If each pixel takes up 8 bits (1 byte) of storage, this requires 1,572,864 × 8 bits, yielding a file size of approximately 1.5MB having to be stored. If we keep the size of the image the same but double the resolution to 1024ppi, the image is captured using 2048×3072 pixels (6MP), this will quadruple the storage requirements to around 6MB but give a much sharper image.
A BITMAP (or BITMAPPED) graphic is stored as a grid of pixels. All components of the image are deconstructed into pixel patterns, be it a line of text or a blank region. When you save a bitmap graphic, you need to store:
• a binary colour code for every pixel (where the number of bits used per pixel does not vary throughout the image);
• the metadata: – width – height – colour depth (the number of bits allocated to each pixel for storing its colour code). In order to reconstruct and display or print the bitmap graphic, the dimensions are used to create a rectangular grid of pixels and each one is set to the correct colour as it is the smallest unit of the graphic that can be changed. A bitmapped format is best for:
• Photographs;
• Hand-drawn images;
• Any image containing regions with gradients of colour.
In a vector graphic, the image is deconstructed into individual shapes. Each individual shape object can be described in terms of its:
• geometric form (square, circle, triangle);
• centre/corner point and position coordinates;
• dimensions;
• edge and centre colours.
For example, to construct a circle as a vector graphic, we would need to store its: • radius;
• circumference thickness;
• inner colour;
• circumference colour;
• position on the larger image canvas. If an amendment is subsequently made to the circle (e.g. it shrinks or changes colour), then the computer will reconstruct the shape after the changes have been applied.
Straight lines can be drawn, rotated, thickened and thinned (note that there will be a minimum width of a line), and will always reconstruct without jagged edges. Vector graphic technology can be costly to create and there is thus a tendency for bitmapped graphics to be the prevailing technology.
This resource is useful for comparing and contrasting vectors and bitmap images.
Bitmap Graphics
• The file is made up of a grid of tiny pixels.
• Users can edit individual pixels.
• They offer high-quality images.
• When stretched the image can become blurred.
• Bitmap files take up a lot of storage space, thus demanding more storage to distribute them.
• Bitmap files take a long time to load as they require a lot of processing, thus slowing down the computer.
Vector Graphics
• Vector-based graphics store details about individual components that make up the image.
• The image is made up of objects defined by mathematical equations.
• The image quality does not depend on resolution.
• Vector-based graphics can be resized without loss of quality. The image can be stretched without loss of clarity.
• The file contains instructions on how the image should be redrawn.
• Compared to a similar-sized bitmap image, the size of the vector graphic file is significantly lower due to the lack of a need to store individual pixel values.
Streaming
If a large video file (Moving image file) is to be played from within a web page, it may take an unacceptable length of time to download in full. Streaming a video involves initiating the playing of the video shortly after the first few seconds of the video file have downloaded. Successive segments are downloaded but not saved and get discarded when played, thus forcing the user to stream the video again should they wish to see it a second time.
Advantages:
• The video is unlikely to be replicated as the user does not save a full copy;
• The user does not have to wait for the entire file to download to their computer;
• The user’s computer does not need to be capable of storing the entire file.
Buffering
During streaming, a video is both downloading in the background and playing in the foreground. An intermediate storage area (small piece of memory) known as a buffer is used to hold the downloaded segments that have not yet been played. The buffer is emptied as the video plays, and refilled via the downloading process. Should the buffer become close to empty because the speed of playback is exceeding the speed at which it is getting refilled by downloading, images of a lesser quality will get downloaded so that the buffer will refill more rapidly and playback can continue uninterrupted. Buffering is used to minimise interruptions to viewing.
Possible Exam Questions
1- Describe what is meant by the term pixel (2 Marks)
2- Explain how pixels are used to create bitmapped images (4 Marks)
3- Explain the affect increasing the resolution has on the file size of an image (2 Marks)
4-Why is it important to consider the file size of an image (2 Marks)
5-Explain how vector images are stored (2 Marks)
6-List 3 benefits of bitmap images over vectors (3 Marks)
7-List 3 benefits of vector images over bitmaps (3 Marks)
8-Explain how buffering and streaming are used to transfer moving image files. (4 Marks)