Top Banner
Skills: none Concepts: an image representation code, the number of bits in a code, the amount of information in an image This work is licensed under a Creative Commons Attribution- Noncommercial-Share Alike 3.0 License. Encoding images
30

Skills: none Concepts: an image representation code, the number of bits in a code, the amount of information in an image This work is licensed under a.

Dec 18, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Skills: none Concepts: an image representation code, the number of bits in a code, the amount of information in an image This work is licensed under a.

Skills: noneConcepts: an image representation code, the number of bits in a code, the amount of information in an image

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 License.

Encoding images

Page 2: Skills: none Concepts: an image representation code, the number of bits in a code, the amount of information in an image This work is licensed under a.

Where does this topic fit?

• Internet concepts– Applications– Technology– Implications

• Internet skills– Application development– Content creation– User skills

Page 3: Skills: none Concepts: an image representation code, the number of bits in a code, the amount of information in an image This work is licensed under a.

Encoding image data

Data type Decade

Numeric 1950s

Alphanumeric 1960s

Text 1970s

Image 1990s

Speech 2000s

Music 2000s

Video 2000s

HD video 2010s

Page 4: Skills: none Concepts: an image representation code, the number of bits in a code, the amount of information in an image This work is licensed under a.

010101011100101010101010101010111010101010101010101010101010100101010101000010110101010101010010101101101010101010110010110010101010100101110101001010010101010101010001001010101011010011010010101010100101101001011100101010101001010101000101010101010101010010101001010101001001001001010101001000101010101110100101001010101010010101010101001010100100101010010101001001010101001010100101010100101010101001010101011110101011100001111011

All data is binary

Page 5: Skills: none Concepts: an image representation code, the number of bits in a code, the amount of information in an image This work is licensed under a.

Data + a code → information

Page 6: Skills: none Concepts: an image representation code, the number of bits in a code, the amount of information in an image This work is licensed under a.

Let’s encode this image

Page 7: Skills: none Concepts: an image representation code, the number of bits in a code, the amount of information in an image This work is licensed under a.

Each pixel has a color

Each color has a code

Page 8: Skills: none Concepts: an image representation code, the number of bits in a code, the amount of information in an image This work is licensed under a.

12 colors, 12 codes

Color CodeBlue 0000Light green 0001Dark green 0010Yellow 0011Orange 0100Red 0101Purple 0110Light grey 0111Dark grey 1000Brown 1001Black 1010White 1011

Page 9: Skills: none Concepts: an image representation code, the number of bits in a code, the amount of information in an image This work is licensed under a.

The image is 800 by 500 pixels

Page 10: Skills: none Concepts: an image representation code, the number of bits in a code, the amount of information in an image This work is licensed under a.

0000 0000 00001011 1011 1011 0101 0101

The codes for a few pixels

Page 11: Skills: none Concepts: an image representation code, the number of bits in a code, the amount of information in an image This work is licensed under a.

800 pixels

500

pixe

ls

How much memory or storage?

Page 12: Skills: none Concepts: an image representation code, the number of bits in a code, the amount of information in an image This work is licensed under a.

800 pixels

500

pixe

ls

• 500 x 800 = 400,000 pixels• 4x400,000 = 1,600,000 bits• 1,600,000/8 = 200,000 bytes

How much memory or storage?

Page 13: Skills: none Concepts: an image representation code, the number of bits in a code, the amount of information in an image This work is licensed under a.

Could we have had more than 12 colors?

Color CodeBlue 0000Light green 0001Dark green 0010Yellow 0011Orange 0100Red 0101Purple 0110Light grey 0111Dark grey 1000Brown 1001Black 1010White 1011

Page 14: Skills: none Concepts: an image representation code, the number of bits in a code, the amount of information in an image This work is licensed under a.

Color CodeBlue 0000Light green 0001Dark green 0010Yellow 0011Orange 0100Red 0101Purple 0110Light grey 0111Dark grey 1000Brown 1001Black 1010White 1011

1100110111101111

Four unused combinations

Page 15: Skills: none Concepts: an image representation code, the number of bits in a code, the amount of information in an image This work is licensed under a.

More bits means more unique codes

A 00B 01C 10D 11

A 0B 1

A 000B 001C 010D 011E 100F 101G 110H 111

A 0000B 0001C 0010D 0011E 0100F 0101G 0110H 0111I 1000J 1001K 1010L 1011M 1100N 1101O 1110P 1111

1-bit code 2-bit code 3-bit code 4-bit code

Do you see a pattern here?

Page 16: Skills: none Concepts: an image representation code, the number of bits in a code, the amount of information in an image This work is licensed under a.

A 000B 001C 010D 011E 100F 101G 110H 111

Start with a three bit code

What is the effect of adding a bit?

Page 17: Skills: none Concepts: an image representation code, the number of bits in a code, the amount of information in an image This work is licensed under a.

000001010011100101110111

Make two copies

What is the effect of adding a bit?

000001010011100101110111

Page 18: Skills: none Concepts: an image representation code, the number of bits in a code, the amount of information in an image This work is licensed under a.

00000001001000110100010101100111

Add a zero to one copy and 1 to the otherDoubling the number of possibilities

What is the effect of adding a bit?

10001001101010111100110111101111

Page 19: Skills: none Concepts: an image representation code, the number of bits in a code, the amount of information in an image This work is licensed under a.

A 0000B 0001C 0010D 0011E 0100F 0101G 0110H 0111

A 000B 001C 010D 011E 100F 101G 110H 111

3-bit code 4-bit code

I 1000J 1001K 1010L 1011M 1100N 1101O 1110P 1111

Adding a bit doubles the number of codes

Page 20: Skills: none Concepts: an image representation code, the number of bits in a code, the amount of information in an image This work is licensed under a.

Color depth

8 bits per pixel → 256 colors

16 bits per pixel → 65.5 thousand colors

24 bits per pixel → 16.7 million colors

32 bits per pixel → 4.3 billion colors

Page 21: Skills: none Concepts: an image representation code, the number of bits in a code, the amount of information in an image This work is licensed under a.

96% reduction – obvious information loss

Both have the same number of pixels – explain the loss of information.

Page 22: Skills: none Concepts: an image representation code, the number of bits in a code, the amount of information in an image This work is licensed under a.

1,080,000 pixels, no information

Page 23: Skills: none Concepts: an image representation code, the number of bits in a code, the amount of information in an image This work is licensed under a.

Pixels ↑ information ↑

Bits per pixel ↑ possible colors ↑ information ↑

The amount of information in an image

Page 24: Skills: none Concepts: an image representation code, the number of bits in a code, the amount of information in an image This work is licensed under a.

An image with a lot of information

http://som.csudh.edu/fac/lpress/presentations/telegeography2010cablemap.jpg

Page 25: Skills: none Concepts: an image representation code, the number of bits in a code, the amount of information in an image This work is licensed under a.

Even more information

http://www.dresden-26-gigapixels.com/dresden26GP

Page 26: Skills: none Concepts: an image representation code, the number of bits in a code, the amount of information in an image This work is licensed under a.

http://gigapan.org/

A library of information-rich images

Page 27: Skills: none Concepts: an image representation code, the number of bits in a code, the amount of information in an image This work is licensed under a.
Page 28: Skills: none Concepts: an image representation code, the number of bits in a code, the amount of information in an image This work is licensed under a.

Summary

Color CodeBlue 0000Light green 0001Dark green 0010Yellow 0011Orange 0100Red 0101Purple 0110Light grey 0111Dark grey 1000Brown 1001Black 1010White 1011

Page 29: Skills: none Concepts: an image representation code, the number of bits in a code, the amount of information in an image This work is licensed under a.

Self-study questions

An image is 800 by 500 pixels, and each pixel can be one of 12 colors. How much memory would it require?

An image is 800 by 500 pixels, and each pixel can be one of 256 colors. How much memory would it require?

How many different colors could one represent using an 8 bit code? A nine bit code?

Can you write a formula to compute the number of unique codes possible given the number of bits in a code?

Page 30: Skills: none Concepts: an image representation code, the number of bits in a code, the amount of information in an image This work is licensed under a.

Information rich images:

http://www.dresden-26-gigapixels.com/dresden26GP

http://som.csudh.edu/fac/lpress/presentations/telegeography2010cablemap.jpg

http://gigapan.org/

http://gigapixel.com

Resources