<<

A browser may support only a certain number of specific colors, creating a from which to choose

Figure 3.11 The Netscape color palette

1 QUIZ

How many bits are needed to represent this palette? Show your work.

2 How to digitize a picture • Sample it → Represent it as a collection of individual dots called • Quantize it → Represent each as one of 224 possible colors (TrueColor)

Resolution = The # of pixels used to represent a picture

3 Digitized Images and Graphics

Whole picture

Figure 3.12 A digitized picture composed of many individual pixels

4 Digitized Images and Graphics

Magnified portion of the picture

See the pixels?

Hands-on: paste the high-res image from the previous slide in Paint, then choose ZOOM = 800

Figure 3.12 A digitized picture composed of many individual pixels

5 QUIZ: Images

A low-res image has 200 rows and 300 columns of pixels. • What is the resolution? • If the pixels are represented in True-Color, what is the size of the file? • Same question in High-Color

6 Two types of image formats

= Storage on a pixel-by-pixel basis • Vector Graphics = Storage in vector (i.e. mathematical) form

7 Raster Graphics

GIF format • Each image is made up of only 256 colors (indexed color – similar to palette!) • But they can be a different 256 for each image! • Supports animation! Example • Optimal for line art

PNG format (“ping” = Portable Network Graphics) Like GIF but achieves greater compression with wider range of No animations

8 format Contains the pixel color values of the image from left to right and from top to bottom • Great candidate for run-length compression! • Lossless, but files are large!

JPEG format Averages color hues over short distances • Lossy compression Optimal for color photographs

9 Vector Graphics

A format that describes an image in terms of lines and geometric shapes

A vector graphic is a series of commands that describe a line’s direction, thickness, and color

The file sizes tend to be smaller because not every pixel is described

Example: Flash

10 Vector Graphics

The good side: Vector graphics can be resized mathematically and changes can be calculated dynamically as needed

The bad side: Vector graphics are not good for representing real-world images

11 3.6 Representing Video

12 Representing Video Video codec COmpressor/DECompressor Methods used to shrink the size of a movie to allow it to be played on a computer or over a network

Almost all video codecs use lossy compressions to minimize the huge amounts of data associated with video

13 QUIZ video A 10-minute videoclip is shot in a resolution of 768x1024 True-Color pixels, and 24 frames/second. • What is the uncompressed size of the video file? • How long would it take to transmit it over a 100 Mbps Ethernet connection?

14 Representing Video

Temporal compression A technique based on differences between consecutive frames: If most of an image in two frames hasn’t changed, why should we waste space to duplicate all of the similar information? Spatial compression A technique based on removing redundant information within a frame: This problem is essentially the same as that faced when compressing still images

15 Chapter Review Questions

• Distinguish between analog and digital information • Explain data compression and calculate compression ratios • Explain the binary formats for negative (two’s complement), fractional, and floating-point values • Describe the characteristics of the ASCII and Unicode character sets • Perform various types of text compression with pencil and paper: Keyword, Run-length, Huffman

16 Chapter Review Questions

• Explain the nature of sound and its representation • Explain how RGB values define a color • Distinguish between raster and vector graphics • Explain temporal and spatial video compression

17 For next time: --Read pages 69-75 of text --Re-solve all today’s quizzes

Homework: 8,9,29,30,31,41,47,49,51,53, 61 --Due Friday, Feb.19

18 EOL6