Representing sound, images, and other data

Cards (47)

  • All data on a computer system is represented using binary patterns, which are sequences of 1s and 0s.
  • A bitmapped graphic (also called a bitmap image) is made up of a grid of pixels.
  • A pixel (short for ‘picture element’) is the smallest element in an image.
  • Each pixel has its own colour value that determines what colour it appears as when displayed.
  • In a monochrome bitmapped graphic, there is one bit per pixel representing black/white.
  • Imagine an image that was captured using a digital camera. Each pixel is a representation of the colours that were detected by the camera's sensor.
  • Many images need to use colours. To add colour, more bits are required for each pixel. The number of bits determines the range of colours. This is known as an image's colour depth.
    For example, using a colour depth of two, ie two bits per pixel, would allow four possible colours.
  • Using three bits per pixel allows eight possible colours. Using four bits per pixel allows sixteen possible colours.
  • The most common way of storing coloured graphics uses a colour depth of twenty-four bits per pixel. This gives us over 16 million different colours!
  • Image resolution refers to the clarity of an image as it appears on a screen or on paper.
  • Resolution can be measured in pixels per inch (ppi) or dots per inch (dpi).
  • Images with high resolutions have many pixels packed into a small space so they appear sharp when viewed at close quarters.
  • Low resolution images contain fewer pixels than higher resolution ones. They take up less storage space but look blurry if displayed at large sizes.
  • Note that the term 'image resolution' is sometimes used to describe the size of a bitmapped graphic in pixels. The size in pixels is calculated by multiplying the width (in pixels) by the height (in pixels) of the image.
  • To find the size of an image file, you multiply the resolution of the image by the colour depth: image file size (in bits) = width (in pixels) × height (in pixels) × colour depth
  • The actual file size of a bitmapped graphic is always greater than the result of its simple file size calculation. This is because, in addition to the pixel data, the file must store additional information so that the image can be reproduced accurately. This additional data is called metadata, which means data about data.
  • Examples of metadata include:
    • Image dimensions (e.g. width in pixels, height in pixels)
    • File format
    • Date and time of creation
    • Geographical location of creation
    • Details about the device used to create the image
    • Camera settings
  • The metadata must be located in a fixed position of the image file, so it can be found and read by any software that displays or uses it. Usually, the metadata is found at the beginning of the file in an area that is referred to as the file header.
  • Image resolution should not be confused with screen or display resolution, which refers to the number of pixels that a screen is set to display. Screen resolution is also expressed by specifying the width of the screen in pixels by the height of the screen in pixels.
  • Common file formats of bitmapped graphics are:
    • Bitmap – file extension is .bmp
    • PNG (Portable Network Graphic) – file extension is .png
    • JPEG (Joint Photographic Experts Group) – file extension is .jpg or .jpeg
    • GIF (Graphics Interchange Format) – file extension is .gif
  • Bitmapped graphics are most commonly created by taking a photo with a digital camera (or mobile phone camera). The image will be stored as a grid of pixels, where each pixel is a digital representation of a colour that was captured by the camera's photo sensors. Most flatbed scanners will also save the captured image as a bitmap.
  • You can create a bitmap yourself by using bitmap editing software. This would be tedious for all but the simplest of images.
  • Vector graphics are images that are made up of lists of objects and their properties. An object is a mathematically or geometrically defined construct, such as a rectangle, line, polygon, or circle. Each of these objects has properties that determine the dimensions (e.g. width, height), appearance (e.g. colour, fill, stroke thickness), and position (e.g. x, y coordinates) of every object in the image. These properties are stored as a list, often called the drawing list.
  • Vector graphics allow for much greater detail without loss of quality when zooming into the image.
  • Some common applications of vector graphics include logos, diagrams, maps, charts, graphs, illustrations, and animations.
  • Examples of vector graphic file types are SVG (Scalable Vector Graphics) and PDF (Portable Document Format).
  • Vector graphics typically take up less storage space because they only store information about the shapes themselves rather than storing lots of individual pixels.
  • Vector graphics have some disadvantages compared to bitmap graphics. For example, it may take longer to load an image if there are many complex objects within it. Also, it may be more difficult to edit certain aspects of the image due to its mathematical nature.
  • The main advantage of bitmap graphics over vector graphics is that they are easier to create and manipulate. They also tend to be faster to render on screen.
  • The colour of an object in a vector graphic is defined by a single property, while in an uncompressed bitmapped graphic, even if a shape is a single colour, the bit pattern for that colour needs to be stored for every pixel in the image.
  • Bitmap graphics can use compression techniques such as JPEG or PNG to reduce their size without losing too much quality.
  • Vector graphics are produced by combining a limited number of shapes, therefore the variety of images that they can represent is restricted. This is why they are mostly used to produce illustrations, cartoons, logos, web designs, etc.
    On the other hand, bitmapped graphics can depict almost any level of complexity and detail. Photographs are always stored as bitmaps.
  • Analogue signals are continuous, whereas digital sounds are discrete.​ Signals can be converted from one form to the other. ​
  • Sound needs to be converted from analogue to digital to be stored and processed by a computer.
  • To convert an analogue sound wave into a digital format requires an input device like a microphone to pick up the sound wave from the source. The microphone transforms the sound wave into an analogue electrical signal.​The signals are then processed by hardware called an analogue to digital converter (ADC), which converts the electrical signals into digital values (binary patterns).​
  • Samples of the analogue signal are taken at regular time intervals and then assigned a binary pattern to it and stored in the computer. Once in a digital format, the sound can be used by the computer and processed with a sound processing software (such as Audacity).​
  • When you want to listen to a digital audio file, the file needs to be converted into analogue electrical signals. A digital to analogue converter (DAC) converts the digital values (binary patterns) stored on the computer back into analogue electrical signals.​ After it has been converted, an output device like a speaker picks up this analogue electrical signal and converts it into an analogue sound wave. This means the sound can be played back and you can hear it.​
    • The analogue sound waves produced by speakers may differ significantly from the original sound waves produced by the source, as it will not have the same quality as the original sound but a sample of it.​
  • The frequency used to sample an analogue signal is called the sampling rate. It is defined as the number of samples taken per second and it is measured in hertz (one hertz is equal to one sample per second). The higher the sampling rate, the better the quality of the audio recording, and the bigger the file size of the recording.
  • The sample resolution determines the number of available digital values that can be used during sampling. If you have a low sample resolution, then the available binary patterns for the samples will be very limited, and the variations in the analogue signal will not be represented accurately in a digital form.