+ All Categories
Home > Documents > Indexed Color - faculty.tarleton.edu · individual dots called pixels •Quantize it → Represent...

Indexed Color - faculty.tarleton.edu · individual dots called pixels •Quantize it → Represent...

Date post: 10-Oct-2020
Category:
Upload: others
View: 0 times
Download: 0 times
Share this document with a friend
18
Indexed Color A browser may support only a certain number of specific colors, creating a palette from which to choose 1 Figure 3.11 The Netscape color palette
Transcript
Page 1: Indexed Color - faculty.tarleton.edu · individual dots called pixels •Quantize it → Represent each pixel as one of 224 possible colors (TrueColor) Resolution = The # of pixels

Indexed Color

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

1

Figure 3.11

The Netscape color palette

Page 2: Indexed Color - faculty.tarleton.edu · individual dots called pixels •Quantize it → Represent each pixel as one of 224 possible colors (TrueColor) Resolution = The # of pixels

QUIZ

How many bits are needed to represent this palette?

Show your work.

2

Page 3: Indexed Color - faculty.tarleton.edu · individual dots called pixels •Quantize it → Represent each pixel as one of 224 possible colors (TrueColor) Resolution = The # of pixels

How to digitize a picture

• Sample it → Represent it as a collection of individual dots called pixels

• Quantize it → Represent each pixel as one of 224 possible colors (TrueColor)

Resolution = The # of pixels used to represent a picture

3

Page 4: Indexed Color - faculty.tarleton.edu · individual dots called pixels •Quantize it → Represent each pixel as one of 224 possible colors (TrueColor) Resolution = The # of pixels

Digitized Images and Graphics

4

Figure 3.12 A digitized picture composed of many individual pixels

Whole

picture

Page 5: Indexed Color - faculty.tarleton.edu · individual dots called pixels •Quantize it → Represent each pixel as one of 224 possible colors (TrueColor) Resolution = The # of pixels

Digitized Images and Graphics

5

Figure 3.12 A digitized picture composed of many individual pixels

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

Page 6: Indexed Color - faculty.tarleton.edu · individual dots called pixels •Quantize it → Represent each pixel as one of 224 possible colors (TrueColor) Resolution = The # of pixels

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

Page 7: Indexed Color - faculty.tarleton.edu · individual dots called pixels •Quantize it → Represent each pixel as one of 224 possible colors (TrueColor) Resolution = The # of pixels

Two types of image formats

• Raster Graphics = Storage on a pixel-by-pixel

basis

• Vector Graphics = Storage in vector (i.e. mathematical) form

7

Page 8: Indexed Color - faculty.tarleton.edu · individual dots called pixels •Quantize it → Represent each pixel as one of 224 possible colors (TrueColor) Resolution = The # of pixels

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 color depth

No animations

8

Page 9: Indexed Color - faculty.tarleton.edu · individual dots called pixels •Quantize it → Represent each pixel as one of 224 possible colors (TrueColor) Resolution = The # of pixels

Bitmap 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

Page 10: Indexed Color - faculty.tarleton.edu · individual dots called pixels •Quantize it → Represent each pixel as one of 224 possible colors (TrueColor) Resolution = The # of pixels

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

Page 11: Indexed Color - faculty.tarleton.edu · individual dots called pixels •Quantize it → Represent each pixel as one of 224 possible colors (TrueColor) Resolution = The # of pixels

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

Page 12: Indexed Color - faculty.tarleton.edu · individual dots called pixels •Quantize it → Represent each pixel as one of 224 possible colors (TrueColor) Resolution = The # of pixels

3.6 Representing Video

12

Page 13: Indexed Color - faculty.tarleton.edu · individual dots called pixels •Quantize it → Represent each pixel as one of 224 possible colors (TrueColor) Resolution = The # of pixels

13

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

Page 14: Indexed Color - faculty.tarleton.edu · individual dots called pixels •Quantize it → Represent each pixel as one of 224 possible colors (TrueColor) Resolution = The # of pixels

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

Page 15: Indexed Color - faculty.tarleton.edu · individual dots called pixels •Quantize it → Represent each pixel as one of 224 possible colors (TrueColor) Resolution = The # of pixels

15

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

Page 16: Indexed Color - faculty.tarleton.edu · individual dots called pixels •Quantize it → Represent each pixel as one of 224 possible colors (TrueColor) Resolution = The # of pixels

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

Page 17: Indexed Color - faculty.tarleton.edu · individual dots called pixels •Quantize it → Represent each pixel as one of 224 possible colors (TrueColor) Resolution = The # of pixels

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

Page 18: Indexed Color - faculty.tarleton.edu · individual dots called pixels •Quantize it → Represent each pixel as one of 224 possible colors (TrueColor) Resolution = The # of pixels

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


Recommended