---
title: "Indexed image pixel colours"
subject: "Multimedia System"
chapter: 3
key: "semester_8/multimedia_system:indexed-image-pixel-colours"
source: https://www.bctengineer.com/q/semester_8/multimedia_system/indexed-image-pixel-colours
site: BCT Engineering
---

# Indexed image pixel colours

Multimedia System · Chapter 3: Images and Graphics

- Asked in: 2072 Asoj, 6 marks
- Video: [True Colour and Indexed Colour Bitmaps](https://www.youtube.com/watch?v=cwHPuU3sHOk) — Computer Science Lessons
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_8/multimedia_system/indexed-image-pixel-colours
- Whole chapter: https://www.bctengineer.com/md/semester_8/multimedia_system/chapter-3

## Question

The table on the left below represents an indexed image (rows and columns numbered 0 to 3). The table on the right is the colour index table. What is the colour of the following pixels: (0,2), (1,1), (1,3), (2,1), (2,2), (3,0).

Indexed image:

| | 0 | 1 | 2 | 3 |
|---|---|---|---|---|
| 0 | 2 | 3 | 0 | 3 |
| 1 | 7 | 2 | 1 | 5 |
| 2 | 5 | 6 | 4 | 4 |
| 3 | 2 | 7 | 5 | 0 |

Colour index table:

| Index | R | G | B |
|---|---|---|---|
| 0 | 0 | 255 | 0 |
| 1 | 255 | 0 | 0 |
| 2 | 0 | 0 | 255 |
| 3 | 0 | 0 | 0 |
| 4 | 255 | 255 | 0 |
| 5 | 127 | 127 | 127 |
| 6 | 255 | 0 | 255 |
| 7 | 255 | 255 | 255 |

## Short answer

Look up the index at each pixel in the image, then its RGB in the colour table. (0,2) index 0 → green; (1,1) index 2 → blue; (1,3) index 5 → grey; (2,1) index 6 → magenta; (2,2) index 4 → yellow; (3,0) index 2 → blue.

## Answer

An indexed image stores, for each pixel, only an index number. The actual colour (R, G, B) is found by looking up that index in the colour index table (palette).

**Convention used:** a pixel (r, c) means row r, column c, both counted from 0, as the question labels rows and columns.

**Step 1: find the index at each pixel**

| Pixel (row, col) | Index in image |
|---|---|
| (0,2) | 0 |
| (1,1) | 2 |
| (1,3) | 5 |
| (2,1) | 6 |
| (2,2) | 4 |
| (3,0) | 2 |

**Step 2: look up each index in the colour table**

| Pixel | Index | (R, G, B) | Colour |
|---|---|---|---|
| (0,2) | 0 | (0, 255, 0) | Green |
| (1,1) | 2 | (0, 0, 255) | Blue |
| (1,3) | 5 | (127, 127, 127) | Grey |
| (2,1) | 6 | (255, 0, 255) | Magenta |
| (2,2) | 4 | (255, 255, 0) | Yellow |
| (3,0) | 2 | (0, 0, 255) | Blue |

**Answer:** (0,2) green, (1,1) blue, (1,3) grey, (2,1) magenta, (2,2) yellow, (3,0) blue.

**Storage note:** with 8 colours, each pixel needs only 3 bits, instead of 24 bits for direct RGB. This is why indexed images are small.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. What does each pixel of an indexed image store?
   A. Its full R, G, B values
   B. An index number that is looked up in a colour table
   C. Only a brightness value
   D. The CMYK ink amounts
   Answer: B. The pixel holds an index; the real colour comes from the colour index table (palette). (Key point: Indexed image idea)

2. What is the index at pixel (1,3), counting rows and columns from 0?
   A. 1
   B. 5
   C. 7
   D. 4
   Answer: B. Row 1 is 7, 2, 1, 5; column 3 gives 5. (Key point: Pixel (r,c) lookup)

3. What colour is pixel (2,1)?
   A. Grey (127,127,127)
   B. Yellow (255,255,0)
   C. Blue (0,0,255)
   D. Magenta (255,0,255)
   Answer: D. Row 2 is 5, 6, 4, 4, so (2,1) has index 6, which is (255,0,255) = magenta. (Key point: Colour of (2,1))

4. With 8 colours in the table, how many bits does each indexed pixel need versus direct RGB?
   A. 8 bits instead of 24
   B. 3 bits instead of 24
   C. 1 bit instead of 8
   D. 24 bits instead of 3
   Answer: B. 8 indices need 3 bits, whereas direct RGB needs 24 bits, so indexed images are small. (Key point: Storage saving)

## Related in other subjects

- [Fleming's right and left hand rules](https://www.bctengineer.com/question.md?key=semester_4%2Felectrical_machine%3Afleming-hand-rules) — Electrical Machine, chapter 1
- [Left and right focal point ratios](https://www.bctengineer.com/question.md?key=semester_5%2Ftheory_of_structures_ii%3Afocal-point-ratios-left-right) — Theory of Structures II, chapter 4
- [Pixel access rate of raster system](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Apixels-per-second-access-time) — Computer Graphics, chapter 1
- [Resize image keeping aspect ratio](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Aresize-image-aspect-ratio) — Computer Graphics, chapter 1
