ข้ามไปยังเนื้อหา

Labs · 9618 1.2 bitmaps + k-means

Fewer Colours: Learning a Palette

Store a picture with only 2, 4, 8 or 16 colours. Choose the colour depth, see the file size, and let k-means learn which colours to keep, round by round.

4 levelsFree bench

In the exam

9618/12 May/June 2022 · Question 1(c) · 2 marks

Describe how changing the colour depth of an image affects its file size.

Points that gain marks

  • A bigger colour depth gives a bigger file; a smaller colour depth gives a smaller file.
  • Because the colour depth is the number of bits for each pixel: more bits per pixel means more data is stored.

In this lab: Level 1 shows it: the same 64 × 40 picture needs 2560 bits at 1 bit per pixel and 10240 bits at 4 bits per pixel.

9618/11 May/June 2021 · Question 1(a)(ii) · 2 marks

An image is scanned with an image resolution of 1024 × 512 pixels and a colour depth of 8 bits per pixel. Calculate an estimate for the file size, giving your answer in mebibytes. Show your working.

Points that gain marks

  • 1024 × 512 = 524 288 pixels; at 8 bits (1 byte) each, that is 524 288 bytes.
  • 524 288 ÷ 1024 ÷ 1024 = 0.5 MiB.

In this lab: The file line in the lab does the same sum in bits: width × height × colour depth.

More real experiments

เข้าสู่ระบบหรือสร้างบัญชี

IGCSE, A-Level & AP