Upload
reynard-stevenson
View
221
Download
1
Tags:
Embed Size (px)
Citation preview
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
Where does this topic fit?
• Internet concepts– Applications– Technology– Implications
• Internet skills– Application development– Content creation– User skills
Encoding image data
Data type Decade
Numeric 1950s
Alphanumeric 1960s
Text 1970s
Image 1990s
Speech 2000s
Music 2000s
Video 2000s
HD video 2010s
010101011100101010101010101010111010101010101010101010101010100101010101000010110101010101010010101101101010101010110010110010101010100101110101001010010101010101010001001010101011010011010010101010100101101001011100101010101001010101000101010101010101010010101001010101001001001001010101001000101010101110100101001010101010010101010101001010100100101010010101001001010101001010100101010100101010101001010101011110101011100001111011
All data is binary
Data + a code → information
Let’s encode this image
Each pixel has a color
Each color has a code
12 colors, 12 codes
Color CodeBlue 0000Light green 0001Dark green 0010Yellow 0011Orange 0100Red 0101Purple 0110Light grey 0111Dark grey 1000Brown 1001Black 1010White 1011
The image is 800 by 500 pixels
0000 0000 00001011 1011 1011 0101 0101
The codes for a few pixels
800 pixels
500
pixe
ls
How much memory or storage?
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?
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
Color CodeBlue 0000Light green 0001Dark green 0010Yellow 0011Orange 0100Red 0101Purple 0110Light grey 0111Dark grey 1000Brown 1001Black 1010White 1011
1100110111101111
Four unused combinations
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?
A 000B 001C 010D 011E 100F 101G 110H 111
Start with a three bit code
What is the effect of adding a bit?
000001010011100101110111
Make two copies
What is the effect of adding a bit?
000001010011100101110111
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
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
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
96% reduction – obvious information loss
Both have the same number of pixels – explain the loss of information.
1,080,000 pixels, no information
Pixels ↑ information ↑
Bits per pixel ↑ possible colors ↑ information ↑
The amount of information in an image
An image with a lot of information
http://som.csudh.edu/fac/lpress/presentations/telegeography2010cablemap.jpg
Even more information
http://www.dresden-26-gigapixels.com/dresden26GP
Summary
Color CodeBlue 0000Light green 0001Dark green 0010Yellow 0011Orange 0100Red 0101Purple 0110Light grey 0111Dark grey 1000Brown 1001Black 1010White 1011
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?
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