<<

Images and Multimedia Systems (Module 1 Lesson 2)

Summary: Sources: H Basic concepts H Course text underlying Images H Dr. Ze-Nian Li’s course H Popular Image File material at: formats http://www.cs.sfu.ca/CourseCentral/365/li/ H Follow this link for a H Human perception of great read on color: color http://www.adobe.com/support/techguides/co lor/colortheory/ H Various Color Models in use and the idea behind them

Graphics: Terminology

H -- picture elements in digital images H Image Resolution -- number of pixels in a (Higher resolution always yields better quality.) m Most common Aspect ratio: 3:4 (lines:columns) H Bit-Map -- a representation for the graphic/image data in the same manner as they are stored in memory. H Bits/ – also contributes to the quality of the image

Monochrome vs.

Monochrome: Grayscale: H Each pixel is stored as a H Each pixel is usually stored single bit (0 or 1) as a byte (value between 0 H A 640 x 480 monochrome to 255) image requires 37.5 KB of H A 640 x 480 grayscale storage. image requires over 300 KB of storage.

Dithering

Dithering is often used for displaying monochrome images H Creating the illusion of new and shades by varying the pattern of dots. Newspaper photographs, for example, are dithered. If you look closely, you can see that different are produced by varying the patterns of and dots. There are no gray dots at all. The more patterns that a device or program supports, the more shades of gray it can represent. H In , dithering is usually called halftoning, and shades of gray are called . Note that dithering differs from gray scaling. In gray scaling, each individual dot can have a different shade of gray.

Color Images (24 vs. 8 bit)

24-bit: 8-bit: H Each pixel is represented H One byte for each pixel by three bytes (e.g., RGB) H Supports 256 out of the H Supports 256 x 256 x 256 millions colors possible, possible combined colors acceptable color quality (16,777,216) H Requires Color Look-Up H A 640 x 480 24-bit color Tables (LUTs) -- Pallete image would require 921.6 H A 640 x 480 8-bit color KB of storage image requires 307.2 KB of H Many 24-bit color images storage (the same as 8-bit are stored as 32-bit grayscale) images, the extra byte of data for each pixel is used to store an alpha value representing special effect information

24-bit color (60KB )

8-bit color (30KB )

System Independent Formats GIF(GIF87a,GIF89a): JPEG: H Graphics Interchange H A standard for Format (GIF) devised by photographic image the UNISYS Corp. and compression created by Compuserve, initially for the Joint Photographics transmitting graphical Experts Group images over phone lines via H Takes advantage of modems. limitations in the human H Uses the Lempel-Ziv Welch vision system to achieve algorithm (compression). high rates of compression H Supports only 8-bit (256) H which color images. allows user to set the H Supports interlacing desired level of quality/compression H GIF89a supports simple animation

…Contd TIFF: Graphics Animation Files: H Developed by the Aldus Corp. H FLC -- main animation or in the 1980's and later moving picture file format, supported by the Microsoft originally created by H Tagged Image File Format Animation Pro (TIFF), stores many different H FLI -- similar to FLC types of images (e.g., H GL -- better quality moving monochrome, grayscale, 8-bit pictures, usually large file & 24-bit RGB, etc.) sizes H TIFF is a lossless format Postscript/ PDF: (when not utilizing the new H A language which JPEG tag which allows for includes text as well as JPEG compression) vector/structured graphics H It does not provide any major and bit-mapped images advantages over JPEG and is H Used in several popular not as user-controllable it graphics programs appears to be declining in (Illustrator, FreeHand) popularity H Does not provide compression, files are often large

System Dependent Formats Windows(BMP): X-windows(XBM): H A system standard graphics H Primary graphics format for file format for Microsoft the X Window system Windows H Supports 24-bit color H Used in PC Paintbrush and H other programs Many public domain graphic H It is capable of storing 24-bit editors, e.g., xv bitmap images H Used in X Windows for storing icons, pixmaps, backdrops, Macintosh(PAINT, PICT): etc. H PAINT was originally used in MacPaint program, initially only for 1-bit monochrome images. H PICT format is used in MacDraw (a vector based drawing program) for storing structured graphics

PNG: The Future H The Portable Network Graphics (PNG) format was designed to replace the older and simpler GIF format and, to some extent, the much more complex TIFF format. H Advantages over GIF: m Alpha channels (variable ) Also known as a mask , it is simply a way to associate variable transparency with an image. m (cross-platform control of image brightness) m Two-dimensional interlacing (a method of progressive display) GIF uses 1-D interlacing. (see the difference in the example at http://data.uta.edu/~ramesh/multimedia/examples/interlacing.html m Better Compression (5-25% better) H Features: m Supports three main image types: truecolor, grayscale and -based (``8-bit''). JPEG only supports the first two; GIF only the third. H Shortcomings: m No Animation

Color in Images and Video

Basics of Color H and Spectra m Visible light is an electromagnetic wave in the 400 nm - 700 nm range.

m Most light we see is not one wavelength, it's a combination of many wavelengths.

Basics of Color (…Contd) H The Human Retina m The eye functions on the same principle as a camera m Each neuron is either a rod or a cone. m The rods contain the elements that are sensitive to light intensities. Rods are not sensitive to color. m Cones come in 3 types: , and . Each responds differently to various of light. The following figure shows the spectral- response functions of the cones and the luminous-efficiency function of the human eye

Cones and Color

H The cones provide humans with vision during the daylight and are believed to separated into three types, where each type is more sensitive to a particular wavelength H The color signal to the brain comes from the response of the 3 cones to the spectra being observed. That is, the signal consists of 3 numbers:

where E is the light and S are the sensitivity functions

Color Composition

H A color can be specified as the sum of three colors. So colors form a 3 dimensional vector space. H The following figure shows the amounts of three primaries needed to match all the wavelengths of the .

Color Models for Images

RGB Additive Model CMY Subtractive Model H A is a 2-D array of H , , and (R,G,B) integer triplets. These (CMY) are complementary triplets encode how much the colors of RGB. corresponding phosphor should be H excited in devices such as a CMY model is mostly used in monitor. printing devices where the H CRT displays have three phosphors color pigments on the paper (RGB) which produce a combination absorb certain colors (e.g., no of wavelengths when excited with red light reflected from cyan electrons ).

Yellow Blue Cyan Red Black(1,1,1) Magenta White(1,1,1) Green

Magenta Black(0,0,0) Green White(0,0,0)

Cyan Blue Red Yellow

Color Models for Video

YUV Model YIQ Model H Human perception is more sensitive to H YIQ is used in NTSC color TV brightness than . broadcasting, it is downward Therefore, instead of separating colors, compatible with B/W TV where one can separate the brightness info. only Y is used. from the color info. H Although U and V nicely define H Y is m Y = 0.299R + 0.587G + 0.114B the color differences, they do not align with the desired human H Chrominance is defined as the difference between a color and a perceptual color sensitivities. In reference white at the same luminance. NTSC, I and Q are used instead. It can be represented by U and V -- the m I = 0.74(R -Y) -0.27(B -Y) = color differences. 0.596R - 0.275G - 0.321B m U = B - Y m Q = 0.48(R - Y) + 0.41(B - Y) = m V = R - Y 0.212R - 0.523G + 0.311B H Eye is most sensitive to Y. Therefore, H any error in the resolution of the Eye is most sensitive to Y, next to luminance (Y) is more important than the I, next to Q. In NTSC broadcast chrominance (U,V) values. TV, 4.2 MHz is allocated to Y, 1.5 H In PAL, 5 (or 5.5) MHz is allocated to Y, MHz to I, 0.55 MHz to Q. 1.3 MHz to U and V. H CD-I and DVI also use the YUV model

Color Models for Video (…Contd)

YCbCr H The YCbCr model is closely related to the YUV, it is a scaled and shifted YUV. m Cb = ((B - Y)/ 2) + 0.5 m Cr = ((R - Y) / 1.6) + 0.5 H The chrominance values in YCbCr are always in the range of 0 to 1. H YCbCr is used in JPEG and MPEG.

Summary: Color

H Color images are encoded as triplets of values. H RGB is an model that is used for light-emitting devices, e.g., CRT displays CMY is a subtractive model that is used often for printers H Sometimes, an alternative CMYK model (K stands for Black) is used in (e.g., to produce darker black than simply mixing CMY). K := min (C, M, Y); C := C – K; M := M – K; Y := Y - K. H Two common color models in imaging are RGB and CMY, two common color models in video are YUV and YIQ. H YUV uses properties of the human eye to prioritize information. Y is the (luminance) image, U and V are the (chrominance) images. YIQ uses similar idea.