Practice Image Representation in CS Thinking

Use these practice problems to test your method after reviewing the concept explanation and worked examples.

Quick Recap

Image representation is the way a computer stores a picture as numeric data. Most digital images are made of pixels arranged in a grid, where each pixel stores color information such as red, green, and blue values.

A digital image is a giant colored spreadsheet: each square has a position and a color value.

Showing a random 20 of 50 problems.

Example 1

easy
A black-and-white scanner uses 1 bit per pixel. What two values can a pixel hold?

Example 2

easy
With 24-bit color (8 bits per RGB channel), how many distinct colors can be represented?

Example 3

challenge
A photographer claims '12-bit RAW captures 4 times more color detail per channel than 10-bit.' Verify or correct the claim using level counts.

Example 4

medium
An image with a 256-color palette stores 8 bits per pixel. How does this compare in size per pixel to true-color 24 bpp?

Example 5

easy
What RGB triple represents pure green at 8 bits per channel?

Example 6

challenge
You must store a 4000ร—30004000 \times 3000 photo at 24 bpp, but the disk has only 30 MB free (use 1ย MB=8,000,0001\text{ MB}=8{,}000{,}000 bits). What minimum compression ratio is required?

Example 7

easy
A pixel has RGB value (0, 0, 255). What color does it represent?

Example 8

easy
Estimate the uncompressed size in bits of a 50ร—5050 \times 50 grayscale image at 8 bits per pixel.

Example 9

medium
A 24-bit image is converted to an 8-bit palette image. By what factor does the per-pixel storage shrink, and what is lost?

Example 10

hard
Compare 8-bit and 10-bit per channel for one channel: how many MORE levels does 10-bit provide, and by what factor?

Example 11

hard
Two images have the same file size in KB but different dimensions: one is 1000ร—10001000 \times 1000 at 8 bpp, the other is 500ร—500500 \times 500 at 32 bpp. Which has more pixels, and which stores more color information per pixel?

Example 12

easy
Each pixel stores 8 bits for red, 8 for green, 8 for blue. How many bits per pixel is this?

Example 13

medium
A pixel has RGB value (255, 255, 0). State the color it shows on screen.

Example 14

medium
Fill in: a JPEG compressed file has the same ____ as the raw image but smaller ____.

Example 15

medium
A pixel stored as binary RGB is `11111111 00000000 11111111`. What color is it in words and decimal RGB?

Example 16

easy
Fill in: doubling only the WIDTH of an image multiplies the total pixel count by ____.

Example 17

easy
An image is 200ร—100200 \times 100 pixels. How many pixels does it contain?

Example 18

medium
A pixel stored as binary RGB is `00000000 11111111 00000000`. State the color and the decimal RGB.

Example 19

medium
A grayscale photo uses 8 bits per pixel. How many gray shades can a pixel display?

Example 20

easy
An image is 100 pixels wide and 50 pixels tall. How many pixels does it contain?