3 Images And Graphics

Multimedia Computing · Unit 3 · 5 hrs

Images and Graphics

Exam-focused notes for Images and Graphics (Multimedia Computing, CSC330): what the TU syllabus asks and how it has actually been tested, with 5 solved past questions from this unit.

Images and Graphics in short

An image is a spatial representation of a real or virtual object in a two- or three-dimensional scene. This chapter covers how an image is represented as digital data, the formats used to capture, store and exchange that data, and how images are synthesised, analysed and transmitted.

Images and Graphics: notes

Digital Image Representation

A digital image is represented as a matrix of numeric values, each one a quantized intensity value. If $I$ is this two-dimensional matrix, then $I(r,c)$ is the intensity at row $r$ and column $c$. The points at which an image is sampled are called pixels (picture elements). The number of distinct intensity values a pixel can hold depends on its colour depth: a binary-valued image uses one bit per pixel, giving only black and white; an 8-bit greyscale image allows 256 gray levels, from 0 (black) to 255 (white); and a 24-bit colour image stores 8 bits each for red, green and blue, giving true colour. A higher-resolution image, with more pixels, carries more visual detail but also needs more storage.

Worked example (uncompressed image size). Uncompressed size is width times height times bit depth, converted from bits to bytes and then to KB or MB using the 1024 convention throughout. For a 640 by 480 image stored in 24-bit true colour: $$ \begin{aligned} \text{Size} &= 640 \times 480\ \text{pixels} \times 24\ \text{bits/pixel} \ &= 7{,}372{,}800\ \text{bits} \ &= \frac{7{,}372{,}800}{8}\ \text{bytes} = 921{,}600\ \text{bytes} \ &= \frac{921{,}600}{1024}\ \text{KB} = 900\ \text{KB} \ &= \frac{900}{1024}\ \text{MB} \approx 0.879\ \text{MB}. \end{aligned} $$

The same image stored as 8-bit greyscale instead needs only $640 \times 480 \times 1\ \text{byte} = 307{,}200$ bytes, exactly one third of the 24-bit size, since colour depth scales storage linearly.

Three colour models describe how pixel values encode colour. The RGB model is additive: red, green and blue light combine in the range 0 to 255 each, so $(255,255,255)$ gives white and $(0,0,0)$ gives black; it is used by monitors, cameras and web graphics. The CMY/CMYK model is subtractive and used for printing, where colour is formed by removing wavelengths from white light reflected off paper; converting from RGB gives $$ C = 1-R, \qquad M = 1-G, \qquad Y = 1-B, $$

and because mixing cyan, magenta and yellow ink rarely produces a true, ink-efficient black, a separate black channel $K = \min(C,M,Y)$ is added, with the remaining channels rescaled as $C' = (C-K)/(1-K)$ (and similarly for $M$ and $Y$). The HSV model (hue, saturation, value) matches how people describe colour: hue is an angle from 0 to 360 degrees around a colour wheel (0 for red, 120 for green, 240 for blue), saturation from 0 (gray) to 1 (fully saturated) measures purity, and value from 0 (black) to 1 measures brightness; it is the model behind most colour pickers in image-editing software.

Because a display or file format may only support a limited palette, dithering is used to simulate colours or shades that are not actually available, by arranging pixels of the available colours in a pattern so the eye blends them into an intermediate shade; it is applied as a form of noise that spreads out, rather than concentrates, the error introduced by reducing colour precision, and is used in both image and audio/video processing.

What this unit covers

  • Digital Image Representation
  • Image and graphics Format
  • Image Synthesis, analysis and Transmission

Digital Image Representation

2081 · 10 marks

Discuss the different types of color models and compare between them with applications.[10]

A color model is a mathematical framework used to describe and represent colors in a standardized way. Different color models are used depending on the application, whether it is display, printing, image processing, or scientific analysis. --- The RGB model is an additive color model where colors...

Open this answer on its own page →

2081 · 5 marks

What do you mean by color dithering technique? Explain. [5]

Show solved answer

Color Dithering Technique

Definition

Color dithering is a technique used in computer graphics and multimedia to simulate a wider range of colors than are actually available in a given color palette or display system. It works by arranging pixels of available colors in specific patterns so that the human eye perceives an intermediate or blended color that does not physically exist in the palette.


Why Dithering is Needed

Modern displays and image formats may be limited in the number of colors they can represent (e.g., an 8-bit display supports only 256 colors). When a true-color image is reduced to a limited palette, many colors cannot be represented exactly. Dithering solves this problem by approximating missing colors using combinations of available ones.


How Dithering Works

The basic principle is:

If two colors A and B are placed close together in a pattern, the human visual system blends them perceptually into an intermediate color C.

For example, alternating black and white pixels in a checkerboard pattern produces the perception of gray.


Types / Methods of Dithering

1. Ordered Dithering (Bayer Dithering)

  • Uses a threshold matrix (Bayer matrix) to decide whether a pixel should be rounded up or down to the nearest available color.
  • The threshold varies spatially in a regular pattern.
  • Fast and simple to implement.

Example (2x2 Bayer Matrix):

| 1  3 |
| 4  2 |

Each pixel's intensity is compared against the corresponding threshold value. If the intensity exceeds the threshold, the pixel is set to the higher color; otherwise, the lower color.


2. Error Diffusion Dithering (Floyd-Steinberg)

  • When a pixel is approximated to the nearest available color, the quantization error (difference between actual and approximated color) is distributed to neighboring pixels.
  • Produces more natural-looking results than ordered dithering.

Error distribution pattern (Floyd-Steinberg):

         [current]   7/16
  3/16    5/16       1/16
  • 7/16 of the error goes to the right neighbor
  • 3/16 to the lower-left, 5/16 directly below, 1/16 to the lower-right

3. Random Dithering

  • A random threshold is used for each pixel instead of a fixed matrix.
  • Simple but produces a noisy appearance.

Advantages of Dithering

AdvantageDescription
Simulates more colorsAchieves smooth gradients with limited palette
Reduces bandingEliminates harsh color boundaries
Improves visual qualityProduces more natural-looking images

Disadvantages of Dithering

DisadvantageDescription
Introduces noise/patternsVisible dot patterns may appear
Increases file sizeMore varied pixel values reduce compression efficiency
Computationally expensiveError diffusion methods require extra processing

Summary

Color dithering is an essential technique in multimedia and computer graphics that compensates for limited color depth by spatially mixing available colors to simulate unavailable ones. It exploits the human eye's tendency to blend closely spaced colors, thereby improving the perceived quality of images displayed on systems with restricted color palettes.

Open this answer on its own page →

2080 · 5 marks

Explain the digital image representation with example. [5]

A digital image is represented by a matrix (2D array) of numeric values, where each value represents a quantized intensity value at a specific location in the image. If I is a two-dimensional matrix, then I(r, c) denotes the intensity value at row r and column c of the matrix. --- - The points at...

Open this answer on its own page →

Image and graphics Format

2081 · 5 marks

Explain the image and graphics format with example. [5]

Image format is defined by how image data is captured, stored, and represented digitally. It can be of two types: The image format is specified by two main parameters: - Spatial Resolution: specified as pixels (e.g., 320 x 240 pixels) - Color Encoding: specified by bits per pixel Encoding Type --...

Open this answer on its own page →

2080 · 5 marks

Difference between bitmap and vector graphics. [5]

Bitmap Graphics: A bitmap is an array of pixel values that map one-to-one to pixels on the screen. It stores images as a collection of individual pixels, where each pixel holds a binary digit (for binary images) or color values representing intensities of red, green, and blue (for color images). ...

Open this answer on its own page →