PIC - Intro to Digital Pictures and Color (Lesson)

APCompSci_LessonTopBanner.png

Intro to Digital Pictures and Color

Introduction

Ever wonder how pictures are stored? How does Photoshop really work? You magically click a button and your picture rotates before your very eyes. Red eye? No problem, we have red eye reduction. Photos that once were mediocre come to life with effects that enhance the color and brighten your picture. Google photos automatically applies effects that will enhance your photos so that they have the quality of a pro. This is just the beginning of what we are seeing done with photos. Cousin Fred missed the family reunion picture? No problem. Just use Photoshop to copy part of another picture of Cousin Fred and insert him into the photo. Ever see a picture on the internet that you just couldn’t believe was real? Probably, all the time. Media computation is a method of teaching programming that requires students to write programs that manipulate media: pictures, sounds, text, and movies. This approach was developed by Dr. Mark Guzdial at Georgia Tech, and is at the center of this module.

In this module, we will be using files that are in the pixLab folder. You can download this zip folder and extract the files for use in this module. To extract the files, right click on the file (from its stored location on your computer) and select extract all. It is important that you keep the images folder and the classes folder together in the pixLab folder.

If you look at an advertisement for a digital camera, it will tell you how many megapixels the camera can record. A digital camera has sensors that record color at millions of points arranged in rows and columns. Each point is a pixel or picture element.

Duck saying a megapixel is one million pixels! 

A 16.2-megapixel camera can store the color of over 16 million pixels. That’s a LOT of pixels! What if you wanted to send this picture to your Grandma via email? That would be a lot of information to send through the internet. Do you need all those pixels? You can send a smaller version of the picture, since it will be displayed on a computer screen. However, have you ever enlarged a picture to the point where you can see the boxes of color? Those are the pixels, and the more pixels you have, the smaller they are and the larger the picture can be before those boxes become visible. The more pixels, the more detail. In the following pictures, you can see that the picture that is enlarged is grainy and you can see the boxes of pixels. This is called pixelation. Pixelation means displaying a picture so magnified that the individual pixels look like small squares.

Grainy picture with caption "notice here that the enlarged portion of the picture is grainy. The individual pixels are visible - like squares." 

Each one of these boxes is a color based on the RGB model. Each red, green, and blue value are in the range from 0 – 255. The RGB color model sometimes also stores an alpha value as well as the red, green, and blue values. The alpha value indicates how transparent or opaque the color. A color that is transparent will let you see some of the color beneath it. 

Colors based on the RGB model 

Computers use binary numbers to represent values using groups of bits. A bit is a binary digit either a 0 or 1. A group or 8 bits forms a byte.

Lab content and images from the College Board.

Review Questions

Click below to answer the Introduction to Digital Pictures and Color review questions.

 

APCompSci_LessonBottomBanner.pngIMAGES CREATED BY GAVS