260 likes | 274 Views
Learn how to digitize pictures by converting them into numbers in binary representation. Explore different options for picture quality and understand the impact of resolution and number of colors. See examples of Elvis pictures in different formats and discover the memory requirements for each. Conclusion highlights the importance of higher resolution and more colors for better picture quality.
E N D
Digitizing Pictures How to Convert Pictures into Numbers
Digitizing Pictures • We already know how to represent numbers in binary. • Divide the picture into very small squares (pixels) and determine the color of each pixel. • Pixel: a “picture element”—a dot • Assign a number to each color and use the binary representation of that number and you are done!
Digitizing Pictures: Options • Two things affect picture quality: • Resolution: number/size of pixels • More pixels = more numbers = more memory. • Number of colors: • More colors = more numbers = more memory.
Elvis Line Art 100% This is a picture of Elvis made up of only 2 colors: black and white.
Elvis Line Art 800% Same picture at 800%. Each pixel is outlined in black.
Elvis Line Art 1600% Same picture at 1600%. Pixel structure is obvious.
Elvis as zeros and ones: • Same picture at 1600%. Pixel structure is obvious. You can actually see the eye!.
Elvis Gray Scale (256 shades) Same picture in “gray scale” – 256 shades of gray. Each pixel is represented by an 8-bit number in the range from 0 [black] to 255 [white]. Note the shades of gray.
Elvis 8-bit color (GIF) Elvis in 8-bit color. Skin colors are not as smooth as with 24-bit color.
Elvis 8-bit color 800% Same picture at 800%.
Elvis 8-bit color 1600% Same picture at 1600%.
Elvis 24-bit color 100% Same picture in 24-bit color: 8 bits for red, 8 bits for green, and 8 bits for blue. Total possible colors is 256 x 256 x 256, or over 16 million. Also called “True Color”. Gives photo-quality displays. True Color:24-bits, 16 million colors
Elvis 24-bit color 800% Same picture at 800%. Pixels are outlined in black.
Elvis 24-bit color 1600% Same picture at 1600%. Pixel structure is obvious.
Graphic Memory Requirements • 16 million colors: • Elvis 24-bit color BMP 127 KB(each pixel is represented by 3 bytes – no compression) • Elvis 24-bit color JPG 16 KB(each pixel is represented by 3 bytes, but with “lossy” compression). • Lossy compression:the picture viewed is not the same pixels as the original. Pixels have been lost.
Lossy Compression • Original After 40 saves
Graphic Memory Requirements • 256 colors: • Elvis 8-bit color BMP 44 KB(each pixel is represented by a single byte, no compression) • Elvis 8-bit color GIF 37 KB(each pixel is represented by a single byte, with “lossless” compression) • Lossless compression:the picture is compressed, but when viewed, all of the original pixels are there.
Side-by-side comparison 2 colors 256 shades 256 colors 16M colors of gray
` 24-bit color 8-bit color Gray scale 1-bit line art Comparison:
Conclusion: • Pictures look better if you have: • More pixels (higher resolution) • This requires more memory. • More colors • This requires more memory.
Paint.NET • Paint.NET is an open-source image editor • Web site: http://www.getpaint.net/