Multimedia Graphics and Image Data Representations

Graphics/Image Data Types

  • Proliferation of file formats in multimedia.

1-bit Images

  • Each pixel is a single bit (0 or 1), called binary image.
  • Also called 1-bit monochrome image (no color).
  • Example: "Lena" image.

8-bit Gray-level Images

  • Each pixel has a gray-value between 0 and 255 (single byte).
  • Bitmap: 2D array of pixel values.
  • Image resolution: Number of pixels (higher is better).
    • High resolution: 1,600×1,2001,600 \times 1,200.
    • Low resolution: 640×480640 \times 480.
  • Frame buffer: Hardware to store bitmap (video card).
  • 8-bit image as bit-planes: Each plane is a 1-bit representation at increasing levels.

Multimedia Presentation

  • Pixel stored as a byte (0 to 255).
  • 640×480640 \times 480 grayscale image: 300 kB.
  • Dithering: Trades intensity resolution for spatial resolution on 1-bit printers.

Dithering

  • Dithering: Calculates dot patterns for printing on 1-bit printers.
  • Replaces pixel value by larger pattern (e.g., 2×22 \times 2 or 4×44 \times 4).
  • Example dither matrix: [0amp;2 3amp;1]\begin{bmatrix} 0 & 2 \ 3 & 1 \end{bmatrix}
  • Ordered dither: Turns on printer bit if intensity is greater than matrix element at pixel position.
  • Algorithm:
    • Iterate through image pixels, compare intensity to dither matrix.
    • O(x,y)=1O(x, y) = 1 if I(x, y) > D(i, j), else O(x,y)=0O(x, y) = 0

Image Data Types

  • Common data types: 24-bit color and 8-bit color.
  • Formats can be platform-specific or cross-platform.
  • Image formats use compression (lossless or lossy).

24-bit Color Images

  • Each pixel is three bytes (RGB).
  • 256×256×256=16,777,216256 \times 256 \times 256 = 16,777,216 possible colors.
  • 640×480640 \times 480 24-bit image: 921.6 kB.
  • Some images use 32-bit (extra byte for alpha value/transparency).

8-bit Color Images

  • Uses a lookup table to store color information.
  • Bytes are indices into a table with 3-byte (color) values.
  • 640×480640 \times 480 8-bit color image: 300 kB.

Color Look-up Tables (LUTs)

  • Stores index/code value for each pixel.

How to devise a color look-up table

  • Divide the RGB cube into equal slices.
  • Scale R and G to 3-bit range (0..7), B to 2-bit range (0..3).
  • Median-cut algorithm: Sort R values, label with "0" or "1" based on median.

Popular File Formats

  • 8-bit GIF.
  • JPEG.

GIF

  • Limited to 8-bit (256) color images.
  • Supports interlacing (4-pass display).
  • Two flavors: GIF87a (original), GIF89a (animation support).

JPEG

  • Most important standard for image compression.
  • Exploits limitations of human vision.
  • User can set quality level/compression ratio.

PNG

  • Portable Network Graphics; supersedes GIF.
  • Up to 48 bits of color.
  • Gamma-correction, alpha-channel.
  • Progressive display (2D fashion, 7 passes through 8×88 \times 8 blocks).

TIFF

  • Tagged Image File Format.
  • Supports additional information via “tags”.
  • Can store 1-bit, grayscale, 8-bit, 24-bit RGB images.
  • Originally lossless, now supports JPEG compression.

EXIF

  • Exchange Image File: for digital cameras.
  • Uses JPEG format.
  • Tags for camera/picture-taking conditions.

Graphics Animation Files

  • Stores graphics animations (series of drawings).
  • Less demanding than video files.
  • Examples: FLC, FLI, GL, animated GIF89.

PS and PDF

  • Postscript: Language for typesetting (vector-based).
  • Includes text and vector graphics.
  • PDF: Portable Document Format (includes LZW compression).

Some Other JPEG Formats

  • WMF (Windows Metafile): Vector format for Windows.
  • BMP: Major system standard for Windows.
  • PAINT and PICT (Macintosh).
  • PPM : graphics format for the X Window system