Back to Student Worksheet
CS Grade 6-8 Answer Key

CS: Representing Data: Pixels, Colors, and Images

How computers store pictures using pixels, color values, and numbers

Answer Key
Name:
Date:
Score: / 15

CS: Representing Data: Pixels, Colors, and Images

How computers store pictures using pixels, color values, and numbers

CS - Grade 6-8

Instructions: Read each problem carefully. Show your work or explain your thinking in the space provided.
  1. 1

    A digital image is made of tiny squares called pixels. Explain what a pixel is and why pixels are important in a digital image.

    A pixel is one tiny square of color in a digital image. Pixels are important because a whole image is created by arranging many pixels in rows and columns.
  2. 2

    An image is 10 pixels wide and 8 pixels tall. How many total pixels are in the image?

    Multiply the number of pixels across by the number of pixels down.

    The image has 80 total pixels because 10 multiplied by 8 equals 80.
  3. 3

    A black-and-white image uses 1 bit for each pixel. In this image, 0 means white and 1 means black. Decode this row of pixels: 0 1 1 0 0 1.

    The decoded row is white, black, black, white, white, black because each bit tells the color of one pixel.
  4. 4

    A 4 by 4 black-and-white image uses 1 bit per pixel. How many bits are needed to store the whole image?

    First find the total number of pixels.

    The image needs 16 bits because a 4 by 4 image has 16 pixels and each pixel uses 1 bit.
  5. 5

    In RGB color, each color is made by mixing red, green, and blue light values. What color is represented by RGB(255, 0, 0)?

    RGB(255, 0, 0) represents bright red because the red value is at its maximum and the green and blue values are 0.
  6. 6

    In RGB color, what color is represented by RGB(0, 255, 0), and how do you know?

    The three numbers are in the order red, green, blue.

    RGB(0, 255, 0) represents bright green because the green value is at its maximum and the red and blue values are 0.
  7. 7

    A pixel has the RGB value RGB(0, 0, 255). Explain what the three numbers mean.

    The first number means there is no red light, the second number means there is no green light, and the third number means the blue light is at its maximum. The pixel is bright blue.
  8. 8

    A simple image grid has these color codes: R means red, B means blue, and W means white. Row 1: R R W W. Row 2: R B B W. Row 3: W B B R. Row 4: W W R R. How many blue pixels are in the image?

    Count only the squares marked with B.

    There are 4 blue pixels in the image. Row 2 has 2 blue pixels and Row 3 has 2 blue pixels.
  9. 9

    An image has a resolution of 1920 by 1080 pixels. What do the numbers 1920 and 1080 describe?

    The number 1920 describes the width of the image in pixels, and 1080 describes the height of the image in pixels.
  10. 10

    Which image has more pixels: Image A is 800 by 600 pixels, and Image B is 400 by 300 pixels. Explain your answer.

    Find width multiplied by height for each image.

    Image A has more pixels. Image A has 480,000 pixels, and Image B has 120,000 pixels, so Image A contains more image data.
  11. 11

    A grayscale image uses numbers from 0 to 255 for each pixel, where 0 is black and 255 is white. Would the value 200 be closer to black, white, or medium gray? Explain.

    The value 200 is closer to white because it is much closer to 255 than to 0.
  12. 12

    A color image uses 24 bits for each pixel. This usually means 8 bits for red, 8 bits for green, and 8 bits for blue. How many total bits are needed for 5 pixels?

    Multiply the number of pixels by the number of bits per pixel.

    The 5 pixels need 120 bits because 5 multiplied by 24 equals 120.
  13. 13

    A tiny image is stored as a list of pixel colors in order from left to right, top to bottom: red, red, red, blue, blue, white. Explain how this list can be used to rebuild the image if the image is 3 pixels wide and 2 pixels tall.

    Place the first 3 pixels in Row 1 and the next 3 pixels in Row 2.

    The first three colors make the top row: red, red, red. The next three colors make the bottom row: blue, blue, white. Knowing the width tells the computer when to start a new row.
  14. 14

    A pixel art file uses run-length encoding to store repeated colors. The code 4W 3B 2W means 4 white pixels, then 3 black pixels, then 2 white pixels. How many total pixels are represented?

    The code represents 9 total pixels because 4 plus 3 plus 2 equals 9.
  15. 15

    Explain one reason why a higher-resolution image usually needs more storage space than a lower-resolution image.

    Think about how much information must be saved for each pixel.

    A higher-resolution image usually needs more storage space because it has more pixels. More pixels means the computer must store more color values.
LivePhysics™.com CS - Grade 6-8 - Answer Key