320 likes | 490 Views
Computing with Images. Semester in Review. What is Computing with Images?. Image editing software Photoshop & GIMP & others PowerPoint Writing programs that manipulate images Python programming & JES 3D graphics and animation software Alice Web design Frontpage & HTML
E N D
Computing with Images Semester in Review
What is Computing with Images? • Image editing software • Photoshop & GIMP & others • PowerPoint • Writing programs that manipulate images • Python programming & JES • 3D graphics and animation software • Alice • Web design • Frontpage & HTML • Video editing software • Movie Maker & iMovie (on the Mac)
But it is more than that It isn’t really about the software we used... It is really about the underlying science
Computing with Images is no more about the software tools than Astronomy is about telescopes! It is really about the science of images!
What’s a picture? • We have seen that programs represent pictures as grids of picture elements or pixels Stephanos with his eraser collection CSC 1040 - Computing with Images
Pixel encodings • RGB Color • 3 colors: red, green, blue • 8 bits/color • 24 bits • Bitmap • 1 bit • Grayscale • 8 bits CSC 1040 - Computing with Images
How much can we encode in 8 bits? • Let’s walk it through. • If we have one bit, we can represent two patterns: 0 and 1. • If we have two bits, we can represent four patterns: 00, 01, 10, and 11. • If we have three bits, we can represent eight patterns: 000, 001, 010, 011, 100, 101, 110, 111 CSC 1040 - Computing with Images
8 bits = 1 byte • General rule: In n bits, we can have 2n patterns • In 8 bits, we can have 28 patterns, or 256 • If we make one pattern 0, then the highest value that we can represent is 28-1, or 255 CSC 1040 - Computing with Images
RGB • In RGB, each color has three component colors: • Amount of redness • Amount of greenness • Amount of blueness • In most computer-based models of RGB, a single byte (8 bits) is used for each • So a complete RGB color is 24 bits, 8 bits of each CSC 1040 - Computing with Images
y = 9 Position: (12,9) x = 12 CSC 1040 - Computing with Images
red=108 green=86 blue=142 y = 9 Color:(108,86,142) Position: (12,9) x = 12 CSC 1040 - Computing with Images
Encoding RGB • Each component color (red, green, and blue) is encoded as a single byte • Colors go from (0,0,0) to (255,255,255) • If all three components are the same, the color is in greyscale • (50,50,50) at (2,2) • (0,0,0) (at position (1,2) in example) is black • (255,255,255) is white CSC 1040 - Computing with Images
Is that enough? • We’re representing color in 24 (3 * 8) bits. • That’s 16,777,216 (224) possible colors • Our eye can discern millions of colors, so it’s probably pretty close • Some graphics systems support 32 bits per pixel • May be more pixels for color, or an additional 8 bits to represent 256 levels of translucence CSC 1040 - Computing with Images
Size of images CSC 1040 - Computing with Images
Compression: to lose or not to lose? • Goal: reduce redundancy • Send the same information using fewer bits • Originally developed for fax transmission • Send high quality documents in short calls • Two basic strategies: • Lossless: can reconstruct exactly • Lossy: can’t reconstruct, but looks the same CSC 1040 - Computing with Images
Bitmap vs. grayscale CSC 1040 - Computing with Images
Human Vision • Closely spaced dots appear solid • But irregularities in diagonal lines can stand out • High frame rates produce apparent motion • Smooth motion requires about 24 frames/sec • Visual acuity varies markedly across features • Discontinuities easily seen, absolutes less crucial CSC 1040 - Computing with Images
Do these colors look the same as ... CSC 1040 - Computing with Images
... as these? CSC 1040 - Computing with Images
Not quite CSC 1040 - Computing with Images
Run length encoding • Opportunity: • Large regions of a single color are common • Approach: • Record # of consecutive pixels for each color • An example of lossless encoding 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Uncompressed 000000000000000000000111111111111100000000000001111111111111111111111 RLE Row 1, 21:0,13:1;13:0;22:1 LZW, etc. use algorithms in addition to RLE 01010101010101010101 CSC 1040 - Computing with Images
Palette selection • Opportunity: • No picture uses all 16 million colors • Human eye does not see small differences • Approach: • Select a palette of 256 colors • Indicate which palette entry to use for each pixel • Look up each color in the palette CSC 1040 - Computing with Images
Once you know about images... • You also know... • Video is just a series of images • Animation is really just a series of images
Once you know how to get and change pixels... • You also know... • What Photoshop is doing when you use the magic wand to select or change the brightness or contrast or color levels • What Photoshop is doing when you apply a filter of some sort or other • It is all about the pixels... and you know what those are
Once you know about how pixels are changed in an image... • You also know... • How “greenscreen” works in movie special effects
Once you know how animation and pixel manipulation works... • You also know... • How PowerPoint shows and animates stuff • How Pixar makes its characters move • How the world of Pandora was created in Avatar • How Forrest Gump shakes hands with JFK • How Hollywood special effects are created
Beware the power of images... • ...and when PowerPoint falls into the wrong hands • This next slide is a real slide from a real presentation
Once you know all of this... • You also know... • That it all comes down to the algorithms • The algorithm is the set of steps used to do something, in the computer or in real life • Everything, ultimately, is an algorithm... sometimes simple... sometimes very complex
Once you know about algorithms... • You also know... • About computing • You are a computer scientist
Once you know about computing... • You also know... • How to perform computing with images!