PadhaikoAll subjects

Images and Graphics

Multimedia System (ENCT 466)

Open in the Padhaiko app

3.1 Uses of images and Graphics

Visual media is the primary carrier of spatial and structural information in multimedia systems. Although used together, images typically refer to real-world scenes captured via cameras or scanners, whereas graphics refer to computer-generated diagrams, illustrations, charts, and 3D renders.

Key Application Domains

  1. User Interfaces & Web Design: Icons, buttons, hero banners, typography rendering, and responsive layouts.
  2. Engineering & Architecture (CAD/CAM): Blueprints, circuit schematics, finite-element stress visualizations, and 3D product prototypes.
  3. Healthcare & Science: X-ray, CT, and MRI diagnostic imaging, microscopy, satellite remote sensing, and weather maps.
  4. Publishing & Advertising: Magazine layouts, infographics, photo retouching, and digital billboards.
  5. Education & E-Learning: Anatomical illustrations, geometric diagrams, and annotated visual step-by-step guides.
  6. Entertainment & Simulation: Game textures, sprites, CGI assets, and virtual-reality environments.

3.2 Digital Image Representation

A digital image is represented either as a raster (bitmap) grid of picture elements (pixels) or as vector geometric primitives.

AspectRaster (Bitmap) GraphicsVector Graphics
Basic UnitDiscrete 2D matrix of colored pixelsMathematical equations (points, lines, Bézier curves, polygons)
Resolution DependencyResolution-dependent: enlarging causes pixelation / jagged edgesResolution-independent: scales cleanly to any size without loss
File Size ScalingDepends on pixel count () and bit depthDepends on geometric complexity (number of paths/objects)
Best Suited ForPhotographs, scanned documents, complex continuous-tone texturesLogos, typography, CAD drawings, technical diagrams, icons
Standard FormatsBMP, PNG, JPEG, GIF, TIFF, WebPSVG, EPS, AI, PDF vector paths

Spatial Resolution, Bit Depth, and Memory Size

Definition

Digital Image Parameters

  1. Spatial Resolution: Total pixel dimensions (width height), or physical sampling density in PPI (pixels per inch) / DPI (dots per inch).
  2. Bit Depth (Color Depth, ): Number of bits assigned to each pixel, determining distinct representable intensity levels or colors:
    • (Binary / Monochrome): colors (black and white); used for fax and line art.
    • Grayscale: shades of gray ( = black to = white).
    • Indexed (Color Lookup Table / LUT): Each pixel stores an index pointing into a -entry palette of RGB colors.
    • True Color (RGB): each for Red, Green, and Blue, yielding colors.
    • RGBA: RGB plus an Alpha channel for transparency/opacity ( to ).
  3. Uncompressed Image Size:

Color Models in Multimedia

Standard Color Models
Color ModelComponentsSynthesis TypePrimary Use
RGBRed, Green, BlueAdditive (light emitted; black, white)Monitors, TVs, cameras, web graphics
CMYKCyan, Magenta, Yellow, Key (Black)Subtractive (ink absorbs light on paper)Color printing and publishing
YCbCr / YUVLuminance () + Blue/Red chrominance ()Perceptual separation of brightness and colorJPEG compression, MPEG video, TV broadcast
HSV / HSLHue, Saturation, Value / LightnessCylindrical perceptual modelColor pickers, artistic image editing

For standard ITU-R BT.601 conversion from RGB to YCbCr:


3.3 Image and graphics Format

Multimedia applications choose file formats according to compression type (uncompressed, lossless, lossy), color depth, transparency, and animation support:

Common Image and Graphics File Formats
FormatTypeCompressionMax Color DepthKey Features
BMPRasterUncompressed (optional RLE)Simple Windows header + raw pixel array; very large files
GIFRasterLossless (LZW) ( colors)Supports 1-bit transparency, interlacing, and frame animation
PNGRasterLossless (DEFLATE / LZ77) / + AlphaFull 8-bit alpha channel, Adam7 interlacing; replaces GIF for stills
JPEGRasterLossy (DCT + Huffman) (YCbCr)High compression () for photos; no transparency
TIFFRasterUncompressed or Lossless (LZW/ZIP)Up to / CMYKMulti-page support; standard for scanning and print prepress
WebPRasterLossy & Lossless + AlphaModern web format smaller than JPEG/PNG; supports animation
SVGVectorPlain XML / gzip (svgz)UnlimitedW3C DOM-scriptable 2D paths; scales cleanly at any DPI
EPS / PDFVector / HybridLossless / JPEG streamsCMYK / RGBDevice-independent print and document exchange

3.4 Working with image and graphics

Manipulating images and graphics involves capture, enhancement, filtering, geometric transforms, and compositing:

  1. Image Acquisition & Digitization:
    • Digital Cameras: Focus light onto a CCD or CMOS sensor grid filtered with a Bayer color filter array (twice as many green pixels as red or blue, matching human luminance sensitivity), followed by demosaicing and ADC.
    • Flatbed Scanners: Sweep a linear light sensor across a physical page at a chosen DPI; scanning an photo at produces pixels.
  2. Point Operations (Pixel-by-Pixel):
    • Brightness & Contrast Adjustment: Linear scaling .
    • Gamma Correction: Non-linear power mapping compensating for display response.
    • Thresholding: Converting grayscale to binary ( if , else ).
    • Histogram Equalization: Redistributing pixel intensities to span the full dynamic range and boost contrast.
  3. Spatial Filtering (Convolution): Applying a small or kernel mask over each pixel's neighborhood:
    • Smoothing / Low-Pass Filters (Box, Gaussian): Reduce random noise by averaging neighbors.
    • Sharpening & Edge Detection (Laplacian, Sobel): Emphasize rapid intensity transitions (high spatial frequencies).
  4. Geometric Transformations & Anti-Aliasing: Translation, scaling, rotation, and shearing require pixel interpolation (nearest-neighbor, bilinear, or bicubic) and anti-aliasing to smooth jagged stair-stepped edges ("jaggies").
  5. Dithering & Quantization: Simulating intermediate shades or colors on low-bit-depth displays using spatial dot patterns (ordered dithering or Floyd–Steinberg error diffusion).
  6. Layers & Alpha Compositing: Blending a foreground pixel with opacity over a background color :

3.5 Image Synthesis, analysis and Transmission

Image Synthesis (Computer Graphics Rendering)

Image synthesis creates 2D raster images mathematically from abstract 2D/3D scene descriptions:

  1. 3D Modeling: Constructing objects using polygon meshes, parametric curves/surfaces (Bézier, B-splines), or constructive solid geometry.
  2. Rendering Pipeline: Model transforms World coordinates Camera/View transform Perspective/Orthographic projection Clipping & Hidden-surface removal (Z-buffer) Rasterization (scan-converting polygons into pixels).
  3. Shading & Illumination: Computing pixel colors from light sources and surface normals using Flat, Gouraud, or Phong shading, texture mapping, or photorealistic Ray Tracing (tracing light rays for reflections, refractions, and shadows).

Image Analysis (Recognition & Extraction)

Image analysis works in the reverse direction of synthesis: extracting structured descriptions, measurements, or semantic labels from raw pixels:

Image Transmission

Transmitting high-resolution images over bandwidth-limited networks requires choosing between sequential and progressive delivery:

  1. Sequential Transmission: Pixels are sent strictly row-by-row from top to bottom. The viewer sees a sharp top strip slowly crawling downward and must wait for of bytes to see the bottom.
  2. Progressive Transmission: Sends a coarse low-resolution or low-frequency preview of the entire image immediately, then refines detail in subsequent passes:
    • Spatial / Interlaced (GIF, PNG Adam7): Sends subsets of pixels spread across the whole image in multiple passes (e.g., PNG's 7-pass Adam7 algorithm).
    • Spectral / Successive Approximation (Progressive JPEG): Sends low-frequency DCT coefficients first (blurred full image), then adds high-frequency detail coefficients.
    • Hierarchical / Pyramidal (JPEG 2000 / Wavelet): Sends a low-resolution thumbnail layer first, followed by difference layers doubling the resolution at each step.

Worked Examples

Example 1

1 (6 marks)

A Full-HD () raster image is stored in two uncompressed formats:

  1. Calculate the uncompressed memory size (in , ) of Format A and Format B (including the LUT).
  2. Compute the memory savings factor achieved by indexed color.

Compute memory size of Format A ( RGBA):

Compute memory size of Format B ( pixel array + LUT):

Compute the memory savings ratio:

(Notice that the LUT overhead is negligible compared to of pixel indices.)

Answer:
  1. Format A ( RGBA) (); Format B ( Indexed + LUT) ().
  2. Memory savings factor ().
Example 2

2 (5 marks)

A semi-transparent foreground pixel has RGB color with alpha opacity , and it is composited over an opaque background pixel .

  1. Compute the resulting composited RGB pixel color .
  2. Compute the luminance of the original foreground pixel using the ITU-R BT.601 formula .

Apply alpha compositing per channel ():

Compute ITU-R BT.601 luminance for :

Answer:
  1. Composited RGB pixel .
  2. Foreground luminance .
Example 3

3 (5 marks)

A color photograph is scanned at with RGB color depth.

  1. Compute the pixel dimensions and the uncompressed file size in ().
  2. Calculate the transmission time over a () link for (a) the uncompressed image and (b) a JPEG-compressed version. Explain why progressive JPEG improves perceived loading speed over sequential JPEG.

Pixel dimensions and uncompressed size:

Transmission time at :

With progressive JPEG, low-frequency DCT coefficients arrive in the first scan ( of data, i.e., under ), letting the user see the entire photograph immediately at low detail while sharper detail fills in progressively.

Answer:
  1. Dimensions ; uncompressed size .
  2. Transmission time: uncompressed ; JPEG . Progressive JPEG renders a complete low-detail preview early instead of loading top-to-bottom.

Exercises

Practice Exercises — Images and Graphics

Question 1

Differentiate between raster (bitmap) and vector graphics. Compare GIF, PNG, JPEG, and SVG with respect to compression type, color depth, transparency, and ideal use cases.

Raster vs. Vector Graphics:

  • Raster graphics store images as a fixed grid of colored pixels; they excel at photographic detail but pixelate when scaled up.
  • Vector graphics store mathematical descriptions of shapes (lines, curves, polygons); they scale infinitely without distortion and suit logos, CAD diagrams, and icons.

Comparison of GIF, PNG, JPEG, and SVG:

  • GIF: Lossless LZW raster, max ( colors), 1-bit transparency, supports simple frame animation.
  • PNG: Lossless DEFLATE raster, up to + full alpha transparency, ideal for screenshots and UI graphics.
  • JPEG: Lossy DCT raster, YCbCr, no transparency, ideal for continuous-tone photographs.
  • SVG: XML vector format, unlimited color/resolution independence, ideal for responsive web icons, charts, and logos.
Answer:

Raster images use pixel grids (resolution-dependent, best for photos), whereas vector graphics use geometric equations (resolution-independent, best for diagrams/logos). GIF ( lossless, animated), PNG (true-color lossless + alpha), JPEG (lossy photographic compression), and SVG (scalable XML vector) serve distinct multimedia roles.

Question 2

Explain the RGB, CMYK, and YCbCr color models. Why do multimedia compression standards such as JPEG and MPEG convert RGB images into YCbCr before compression?

Color Models:

  • RGB (Red, Green, Blue): Additive model where light primaries combine to form white; used in cameras and display screens.
  • CMYK (Cyan, Magenta, Yellow, Black): Subtractive ink model used in physical printing where inks absorb reflected white light.
  • YCbCr: Separates brightness (luminance ) from color differences (chrominance ).

Why JPEG/MPEG Use YCbCr: The human visual system has much higher spatial acuity for brightness () than for color hue (). Converting RGB to YCbCr allows chroma subsampling (e.g., , reducing and resolution by half horizontally and vertically), cutting raw color data by immediately with virtually no visible quality loss.

Answer:

RGB is additive (displays), CMYK is subtractive (print), and YCbCr separates luminance () from chrominance (). JPEG/MPEG convert RGB to YCbCr so chrominance components can be subsampled at lower resolution without noticeable visual degradation, exploiting the human eye's lower sensitivity to color detail compared to brightness.

Question 3

Contrast image synthesis and image analysis, outlining the major pipeline stages of each. Also distinguish between sequential and progressive image transmission.

Image Synthesis vs. Image Analysis:

  • Image Synthesis (Rendering): Generates 2D raster images from 3D models via Modeling Geometric/View Transforms Projection & Clipping Hidden-Surface Removal Shading/Texturing & Rasterization.
  • Image Analysis (Vision): Extracts symbolic meaning from raster images via Acquisition Preprocessing (filtering/denoising) Segmentation Feature Extraction Classification/Recognition.

Sequential vs. Progressive Transmission:

  • Sequential transmission sends pixel rows strictly top-to-bottom.
  • Progressive transmission sends a coarse overview of the entire image first (via spatial interlacing as in PNG Adam7 or spectral DCT refinement as in Progressive JPEG) and adds detail in subsequent passes, giving users an instant full-frame preview over slow networks.
Answer:

Image synthesis transforms geometric models into pixels (modeling, projection, shading, rasterization), whereas image analysis extracts structured information from pixels (preprocessing, segmentation, feature extraction, recognition). Sequential transmission renders top-to-bottom, while progressive transmission delivers a coarse full-frame preview first and refines sharpness over multiple passes.

Question 4

A UHD display frame has resolution pixels at True Color.

  1. How many total pixels and how many distinct colors can each pixel represent?
  2. Calculate the uncompressed framebuffer size in ().
  3. If the image is saved as a compressed file with a compression ratio, what is the resulting file size in ?

Total pixels and color palette:

Uncompressed framebuffer and compressed size:

Answer:
  1. Total pixels ; distinct colors ().
  2. Uncompressed size .
  3. Compressed size at .
Question 5
  1. An document is scanned in grayscale at . Calculate the total pixel count and the uncompressed file size in ().
  2. A foreground graphic pixel with opacity is blended over a background pixel . Compute the resulting RGB values.

Scanned document pixel count and size:

Alpha blending computation:

Answer:
  1. Total pixels ; uncompressed size .
  2. Blended RGB pixel .
← Sound/Audio SystemVideo and Animation →