What Youll Learn Today What is digital information? How to - - PDF document

what you ll learn today
SMART_READER_LITE
LIVE PREVIEW

What Youll Learn Today What is digital information? How to - - PDF document

CS101 Lecture 14: Digital Images Aaron Stevens 22 February 2011 With Thanks to John Magee and his dog Cody 1 What Youll Learn Today What is digital information? How to describe an image What is color? How do pictures get


slide-1
SLIDE 1

1

1

Aaron Stevens

22 February 2011

With Thanks to John Magee and his dog Cody

CS101 Lecture 14: Digital Images

2

What You’ll Learn Today

– What is digital information? – How to describe an image – What is color? – How do pictures get encoded into binary representation? – Why do images take so long to download from the web?

slide-2
SLIDE 2

2

3

A picture is worth…

… a thousand words? Describe this image with enough detail to recreate it. How would a computer describe the image?

4

Analog and Digital Information

Computers are finite! How do we represent an infinite world?

We represent enough of the world to satisfy our computational needs and our senses of sight and sound.

slide-3
SLIDE 3

3

5

Analog and Digital Information

We say that information can be represented in one of two ways: analog or digital. Analog A continuous representation, analogous to the actual information it represents. Digital A discrete representation, breaking the information up into finite elements.

6

Analog Information

Example: Analog Thermometer The mercury (or alcohol) rises continuously in direct proportion to the temperature. What exactly is this reading?

slide-4
SLIDE 4

4

7

Digital Information

Example: Digital Thermometer

This reading is discrete. Some

detail is lost in converting to digital information. What is the actual temperature?

8

Analog and Digital Information

Computers store information in binary numbers. For anything else, we need to digitize the data.

Digitizing

Creating a discrete representation of analog data, suitable for storage and manipulation by a digital computer. – Digitizing involves sampling and quantizing.

slide-5
SLIDE 5

5

9

Digitizing an Image: Sampling

Sampling: Taking measurements (of color) at discrete locations within the image. What sampling rate should we use?

Photo is 2.5 x 3.5 inches

10

Digitizing an Image: Sampling

Sampling: Taking measurements (of color) at discrete locations within the image. 16 samples per inch (in each direction)

slide-6
SLIDE 6

6

11

Digitizing an Image: Sampling

Sampling: Measure the color for each pixel, and record that color. 16 pixels per inch

Pixel is short for picture element - a discrete point of light (color) in a picture.

12

Digitizing an Image: Sampling

Sampling: Measure the color for each pixel, and record that color. 32 pixels per inch

Pixel is short for picture element - a discrete point of light (color) in a picture.

slide-7
SLIDE 7

7

13

What Digital Cameras Do

A digital camera has ab image sensor which measures the color at each pixel.

– Megapixel ~ 1 million pixels – One megapixel: 1200 * 900 – 10 megapixels: 3872 * 2592

14

Consider this image…

Several million pixels….

slide-8
SLIDE 8

8

15

Zoom in: it appears pixelated

Why do zoomed images appear pixelated? Because once the image is digitized, we cannot recover information between the pixels.

What is color? How can we describe a color?

slide-9
SLIDE 9

9

17

Color is light, and light is a wave

AM radio waves are about 100 meters FM radio/TV waves are about 1 meter Light waves are about 0.000005 meters

18

Measuring Colors

Color Our perception of the frequencies of light that reach the retinas of our eyes.

The human retina has three types of color photoreceptor cone cells that correspond to the colors of red, green, and blue.

Spectra of visible light (in nm)

slide-10
SLIDE 10

10

19

RGB Encoding

The RGB color model is an additive model, in which red, green, and blue (RGB) colors are combined in various ways to reproduce other colors. + + =

20

RGB Encoding

Color is expressed as an RGB value – three numbers that indicate the relative contribution of each of these primary colors. Color mixing example: Turn on all red and all green and no blue, which results in a bright yellow.

slide-11
SLIDE 11

11

21

Quantization of colors

Quantization is the process of assigning discrete values to measurements taken in samples. We need to make choices about:

– Range of values (maximum, minimum) – Number of steps between max and min

22

Quantization: Color Depth

Color Depth refers to the number of bits used to represent a color. Color Graphics Adapter The original CGA color monitor from IBM.

6 bits total, 2 bits per color supported up to 64 possible colors (26 = 64) (only 16 at a time, though)

The standard 16 CGA colors

slide-12
SLIDE 12

12

23

Quantization: Color Depth

16 bits: HiColor 5 bits for each number in RGB 1 bit for transparency

– 15 color bits  215 or 32,768 colors

24 bits: TrueColor 8 bits used for each number in RGB 8 bits used for transparency (called alpha)

– 24 color bits  224 or 16,777,216 colors – 8 alpha bits  28 or 256 degrees of transparency

24

A Sampling of RGB Color Codes

slide-13
SLIDE 13

13

25

Why such long downloads?

Raster/Bitmap Graphics Storage of data on a pixel-by-pixel basis

– Bitmap (BMP), GIF, JPEG, and PNG, for example

How much data is required to represent a picture?

– Typical size might be 1024 by 768 pixels (~ 800,000 pixels) – At 3 bytes per pixel, that’s 2,400,000 bytes for one picture. – A 10Mpixel picture would be 30,000,000 bytes.

26

  • Oh. A dog in hexadecimal.
slide-14
SLIDE 14

14

27 28

What You Learned Today

– Analog and Digital Information – Sampling: Pixels and Resolution – RGB Color Encoding – Quantizing: Color Depth – Factors in image file size

slide-15
SLIDE 15

15

29

Student To Dos

–HW05 due Wednesday 2/23 –Readings:

  • Wong ch 1 pp 13-19, ch 2, pp 26-44 (today)
  • Wong ch 3, pp 66-86 (WED)