Images and Graphics
Open in the Padhaiko app3.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
- User Interfaces & Web Design: Icons, buttons, hero banners, typography rendering, and responsive layouts.
- Engineering & Architecture (CAD/CAM): Blueprints, circuit schematics, finite-element stress visualizations, and 3D product prototypes.
- Healthcare & Science: X-ray, CT, and MRI diagnostic imaging, microscopy, satellite remote sensing, and weather maps.
- Publishing & Advertising: Magazine layouts, infographics, photo retouching, and digital billboards.
- Education & E-Learning: Anatomical illustrations, geometric diagrams, and annotated visual step-by-step guides.
- 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.
| Aspect | Raster (Bitmap) Graphics | Vector Graphics |
|---|---|---|
| Basic Unit | Discrete 2D matrix of colored pixels | Mathematical equations (points, lines, Bézier curves, polygons) |
| Resolution Dependency | Resolution-dependent: enlarging causes pixelation / jagged edges | Resolution-independent: scales cleanly to any size without loss |
| File Size Scaling | Depends on pixel count () and bit depth | Depends on geometric complexity (number of paths/objects) |
| Best Suited For | Photographs, scanned documents, complex continuous-tone textures | Logos, typography, CAD drawings, technical diagrams, icons |
| Standard Formats | BMP, PNG, JPEG, GIF, TIFF, WebP | SVG, EPS, AI, PDF vector paths |
Spatial Resolution, Bit Depth, and Memory Size
Digital Image Parameters
- Spatial Resolution: Total pixel dimensions (width height), or physical sampling density in PPI (pixels per inch) / DPI (dots per inch).
- 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 ).
- Uncompressed Image Size:
Color Models in Multimedia
| Color Model | Components | Synthesis Type | Primary Use |
|---|---|---|---|
| RGB | Red, Green, Blue | Additive (light emitted; black, white) | Monitors, TVs, cameras, web graphics |
| CMYK | Cyan, Magenta, Yellow, Key (Black) | Subtractive (ink absorbs light on paper) | Color printing and publishing |
| YCbCr / YUV | Luminance () + Blue/Red chrominance () | Perceptual separation of brightness and color | JPEG compression, MPEG video, TV broadcast |
| HSV / HSL | Hue, Saturation, Value / Lightness | Cylindrical perceptual model | Color 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:
| Format | Type | Compression | Max Color Depth | Key Features |
|---|---|---|---|---|
| BMP | Raster | Uncompressed (optional RLE) | Simple Windows header + raw pixel array; very large files | |
| GIF | Raster | Lossless (LZW) | ( colors) | Supports 1-bit transparency, interlacing, and frame animation |
| PNG | Raster | Lossless (DEFLATE / LZ77) | / + Alpha | Full 8-bit alpha channel, Adam7 interlacing; replaces GIF for stills |
| JPEG | Raster | Lossy (DCT + Huffman) | (YCbCr) | High compression () for photos; no transparency |
| TIFF | Raster | Uncompressed or Lossless (LZW/ZIP) | Up to / CMYK | Multi-page support; standard for scanning and print prepress |
| WebP | Raster | Lossy & Lossless | + Alpha | Modern web format smaller than JPEG/PNG; supports animation |
| SVG | Vector | Plain XML / gzip (svgz) | Unlimited | W3C DOM-scriptable 2D paths; scales cleanly at any DPI |
| EPS / PDF | Vector / Hybrid | Lossless / JPEG streams | CMYK / RGB | Device-independent print and document exchange |
3.4 Working with image and graphics
Manipulating images and graphics involves capture, enhancement, filtering, geometric transforms, and compositing:
- 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.
- 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.
- 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).
- 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").
- Dithering & Quantization: Simulating intermediate shades or colors on low-bit-depth displays using spatial dot patterns (ordered dithering or Floyd–Steinberg error diffusion).
- 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:
- 3D Modeling: Constructing objects using polygon meshes, parametric curves/surfaces (Bézier, B-splines), or constructive solid geometry.
- Rendering Pipeline: Model transforms World coordinates Camera/View transform Perspective/Orthographic projection Clipping & Hidden-surface removal (Z-buffer) Rasterization (scan-converting polygons into pixels).
- 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:
- Segmentation: Partitioning an image into meaningful foreground objects and background (via thresholding, region growing, or edge linking).
- Feature Extraction: Computing geometric invariants (area, perimeter, moments), color histograms, or local descriptors.
- Object Recognition / OCR: Matching extracted features against trained models or templates.
Image Transmission
Transmitting high-resolution images over bandwidth-limited networks requires choosing between sequential and progressive delivery:
- 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.
- 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
1
A Full-HD () raster image is stored in two uncompressed formats:
- Format A: RGBA True Color.
- Format B: Indexed Color using a -entry Color Lookup Table (LUT), where each LUT entry holds a RGB color.
- Calculate the uncompressed memory size (in , ) of Format A and Format B (including the LUT).
- 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.)
- Format A ( RGBA) (); Format B ( Indexed + LUT) ().
- Memory savings factor ().
2
A semi-transparent foreground pixel has RGB color with alpha opacity , and it is composited over an opaque background pixel .
- Compute the resulting composited RGB pixel color .
- 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 :
- Composited RGB pixel .
- Foreground luminance .
3
A color photograph is scanned at with RGB color depth.
- Compute the pixel dimensions and the uncompressed file size in ().
- 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.
- Dimensions ; uncompressed size .
- 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
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.
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.
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.
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.
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.
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.
A UHD display frame has resolution pixels at True Color.
- How many total pixels and how many distinct colors can each pixel represent?
- Calculate the uncompressed framebuffer size in ().
- 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:
- Total pixels ; distinct colors ().
- Uncompressed size .
- Compressed size at .
- An document is scanned in grayscale at . Calculate the total pixel count and the uncompressed file size in ().
- 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:
- Total pixels ; uncompressed size .
- Blended RGB pixel .