Image Representation Examples in CS Thinking

Start with the recap, study the fully worked examples, then use the practice problems to check your understanding of Image Representation.

This page combines explanation, solved examples, and follow-up practice so you can move from recognition to confident problem-solving in CS Thinking.

Concept 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.

Read the full concept explanation →

How to Use These Examples

  • Read the first worked example with the solution open so the structure is clear.
  • Try the practice problems before revealing each solution.
  • Use the related concepts and background knowledge badges if you feel stuck.

What to Focus On

Core idea: Image quality depends on how many pixels there are and how much color information each pixel stores.

Common stuck point: Resolution and file format are different ideas. Two images can have the same resolution but different file sizes.

Sense of Study hint: First identify the width and height in pixels. Then check how color is stored, such as grayscale or RGB. Finally, compare how file formats compress that pixel data.

Worked Examples

Example 1

medium
An image is enlarged on screen from 100x100 to 400x400 pixels by repeating each pixel 4x4 times. Does the file size change, and what visual effect appears?

Answer

file size same; pixelation appears\text{file size same; pixelation appears}

First step

1
The underlying data is still 100×100100 \times 100 pixel values.

See the full worked solution + why-it-works coaching

SetupKey insightWhy it worksCommon pitfallConnection

Unlock answer keys One Family plan — every worked solution, all subjects

Example 2

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

Practice Problems

Try these problems on your own first, then open the solution to compare your method.

Example 1

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

Example 2

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

Example 3

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

Example 4

easy
How many bits are needed per channel to represent exactly 256 brightness levels?

Example 5

easy
A grayscale image uses 1 bit per pixel. How many shades can each pixel show?

Example 6

easy
Estimate the uncompressed size in bits of a 10×1010 \times 10 image at 24 bits per pixel.

Example 7

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

Example 8

easy
If you double both the width and height of an image, how does the pixel count change?

Example 9

medium
A photo is 2000×15002000 \times 1500 pixels at 24 bits per pixel. Compute the uncompressed size in megabytes (use 1 MB=8,000,0001\text{ MB}=8{,}000{,}000 bits).

Example 10

medium
Image A is 16-bit color, image B is 24-bit color, same dimensions. How many times more colors can B represent than A?

Example 11

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 12

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

Example 13

medium
A bilevel scanner produces a 1000×10001000 \times 1000 image at 1 bit per pixel. What is the raw size in kilobytes (use 1 KB=80001\text{ KB}=8000 bits)?

Example 14

medium
Two images both display at the same size on screen, but one is 50x50 pixels scaled up and one is 500x500 pixels. Which holds more actual image data, and why?

Example 15

medium
An image format claims '10:1 compression' on a 9 MB raw photo. What is the compressed size, and is resolution changed?

Example 16

medium
How many bits per pixel are needed to represent exactly 1,000,000 distinct colors (round up)?

Example 17

challenge
A camera offers 12-bit-per-channel RAW vs 8-bit-per-channel JPEG. For one channel, how many MORE distinct levels does 12-bit provide than 8-bit, and by what factor?

Example 18

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 19

challenge
A designer needs at least 16.7 million colors and a 1920×10801920 \times 1080 display. Verify whether 24-bit color suffices for the color need, and compute one frame's raw size in MB (1 MB=8,000,0001\text{ MB}=8{,}000{,}000 bits).

Example 20

medium
A 640×480640 \times 480 image at 8 bits per pixel (256-color palette) has what raw size in kilobytes (1 KB=80001\text{ KB}=8000 bits)?

Example 21

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

Example 22

easy
A pixel uses 4 bits per channel for R, G, B. How many bits per pixel total?

Example 23

easy
How many distinct colors can a 16-bit color image represent?

Example 24

easy
How many bits per pixel are needed to represent exactly 16 colors?

Example 25

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

Example 26

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

Example 27

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

Example 28

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

Example 29

medium
A photo is 4000×30004000 \times 3000 pixels at 24 bpp. Compute the raw size in MB (use 1 MB=8,000,0001\text{ MB} = 8{,}000{,}000 bits).

Example 30

medium
Image A: 800×600800 \times 600 at 24 bpp. Image B: 400×300400 \times 300 at 24 bpp. By what factor is A larger?

Example 31

medium
An icon is 32×3232 \times 32 at 32 bpp (RGBA). Raw size in bits?

Example 32

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

Example 33

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 34

medium
Compute the raw size in KB of a 200×150200 \times 150 image at 24 bpp (use 1 KB=80001\text{ KB} = 8000 bits).

Example 35

medium
How many bits per pixel are needed to represent at least 5000 distinct colors?

Example 36

medium
An image is described as '300 ppi' and printed at 6×46 \times 4 inches. How many pixels wide is the underlying image?

Example 37

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

Example 38

medium
A 500×500500 \times 500 image is stored at 16 bpp. Compute the raw size in KB (use 1 KB=80001\text{ KB} = 8000 bits).

Example 39

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

Example 40

hard
A camera produces a 24 MP image at 24 bpp. Raw size in MB (use 1 MB=8,000,0001\text{ MB} = 8{,}000{,}000 bits)?

Example 41

hard
An animation is 30 frames per second, each frame 1280×7201280 \times 720 at 24 bpp. Raw bandwidth in MB per second (use 1 MB=8,000,0001\text{ MB} = 8{,}000{,}000 bits)?

Example 42

hard
A storage budget of 5 MB (1 MB=8,000,0001\text{ MB} = 8{,}000{,}000 bits) holds a 2000×20002000 \times 2000 image at 24 bpp after compression. What minimum compression ratio is required?

Example 43

hard
An image is 1024×7681024 \times 768 and uses indexed color with a 64-color palette. Raw size in bits?

Example 44

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 45

challenge
A frame buffer must store a 3840×21603840 \times 2160 display at 32 bpp. Compute the required memory in MB (use 1 MB=8,000,0001\text{ MB} = 8{,}000{,}000 bits) and explain why double-buffering doubles the requirement.

Example 46

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.

Background Knowledge

These ideas may be useful before you work through the harder examples.

data representationbinary