Cambridge International AS & A Level Computer Science 9618 · Paper 1

Chapter 1.2 Multimedia 多媒体表示

从“电脑怎样保存一张图片和一段声音”开始,逐步建立 bitmap、vector graphic、sampling 与 file-size calculation 的完整概念。适合第一次学习本章的学生。

Before you begin

这章到底要学会什么?

电脑只能直接处理 binary data,但现实中的照片、图标和声音并不是一串现成的 0 与 1。本章研究的核心问题是:怎样把这些多媒体信息转换成可以存储和处理的数字数据?

考纲范围学生最终需要做到
Bitmap image解释 pixel、file header、image resolution、screen resolution、colour depth / bit depth,并描述位图如何编码。
Bitmap calculation估算未压缩位图的 file size,并正确处理 bits、bytes、MB 与 KiB。
Image quality解释 resolution 或 colour depth 改变后,为什么 image quality 与 file size 会改变。
Vector graphic解释 drawing object、property、drawing list,并能针对任务选择 bitmap 或 vector。
Sound解释 analogue sound 如何 sampling 成 digital data,并分析 sampling rate 与 sampling resolution 对 accuracy 和 file size 的影响。
学习方法

每一阶段先理解“数据发生了什么变化”,再记英文术语。真题答案要写出因果链,不要只写 better quality 或 bigger file。

Stage 1

数字图像与 pixel

把一张数字图片放大到足够多倍,会看到许多小方格。每一个最小方格称为一个 pixel(像素)。位图并不是保存“猫”“树”或“文字”的含义,而是保存每个 pixel 应该显示什么 colour。

这张示意图只有 8 × 6 = 48 pixels。每个方格只能保存一种 colour。
Image resolution
图像横向 pixels 数量 × 纵向 pixels 数量。例如 1920 × 1080。它描述文件中的图像。
Screen resolution
显示屏横向与纵向可以显示的 pixels 数量。它描述物理屏幕,不等于图像文件本身的 resolution。
Colour depth / bit depth
用于表示每个 pixel colour 的 bits 数量。若使用 n bits,则最多有 2^n 种不同 colour codes。
File header
保存关于文件的 metadata,例如 file type、image dimensions、colour depth、compression information 或 pixel data 的位置。
不要混淆

Image resolution 说明图片文件有多少 pixels;screen resolution 说明屏幕能显示多少 pixels;colour depth 说明每个 pixel 需要多少 bits。

Stage 2

Bitmap image 是怎样编码的?

编码一张位图需要解决两个问题:怎样表示每个 pixel 的 colour,以及读取文件时怎样知道图像的尺寸和格式。

Image→Grid of pixels→Colour code for each pixel→Codes stored in sequence

一个 2-bit colour depth 的例子

2 bits 可以产生 2² = 4 个不同组合,所以最多表示 4 种颜色:

Binary colour code示例颜色
00White
01Yellow
10Blue
11Black

若最前面的四个 pixels 是 blue、blue、yellow、black,pixel data 可以从 10 10 01 11 开始。实际文件还需要 file header,告诉软件应该怎样解释后面的 bits。

组成单位:pixels → 编码方式:每种 colour 有 unique binary code → 存储:各 pixel 的 code 按顺序保存
Stage 3

计算 bitmap file size

对未压缩位图,pixel data 的估算只需要三个量:横向 pixels、纵向 pixels、每个 pixel 的 bits。

File size in bits = width in pixels × height in pixels × colour depth in bits

完整例题

一张图宽 1000 pixels、高 2000 pixels、colour depth 为 16 bits:

Number of pixels = 1000 × 2000 = 2 000 000 File size in bits = 2 000 000 × 16 = 32 000 000 bits File size in bytes = 32 000 000 ÷ 8 = 4 000 000 bytes File size in MB = 4 000 000 ÷ 1 000 000 = 4 MB
目标单位从 bits 开始的转换
bytes÷ 8
kB÷ 8,之后 ÷ 1000
KiB÷ 8,之后 ÷ 1024
MB÷ 8,之后 ÷ 1 000 000
MiB÷ 8,之后 ÷ 1 048 576
考试易错点

MB 使用 1000 的倍数;MiB 使用 1024 的倍数。题目要求 show your working 时,必须写出乘法和单位转换。

Stage 4

为什么 quality 和 file size 会改变?

改变 image resolution

增加 resolution 表示横向或纵向包含更多 pixels。更多 pixels 可以记录更细小的图像变化,因此图像通常更 sharp、less pixelated,也更接近原图;但需要保存更多 colour codes,所以 file size 增加。

Higher image resolution → more pixels → more detail / less pixelation → more pixel data → larger file size

改变 colour depth

增加 colour depth 表示每个 pixel 使用更多 bits。可用 colour 数量从 2^n 增加,色彩和明暗变化可以更接近原图;但每个 pixel 都要保存更多 bits,所以 file size 增加。

Higher colour depth → more bits per pixel → more possible colours → more accurate colour → larger file size
无效的答案

只写 “quality is better and file size is bigger” 没有解释为什么。Explain 题需要写出中间原因:more pixels 或 more bits per pixel。

为什么实际文件可能更大?

上面的公式只估算 pixel data。真实文件还要保存 file header 和其他 metadata,所以 actual file size 可能比计算值更大。

Stage 5

Vector graphic:保存“画法”,不是保存 pixels

Vector graphic 把图像拆成多个 drawing objects,例如 line、circle、rectangle 和 text。每个 object 有自己的 properties,例如 position、size、fill colour、line colour 与 line weight。

Bitmap Stores colourcode for eachpixel Vector Object: circleFill: yellowPosition: x, yRadius: 45
Bitmap 保存每个 pixel 的 colour;vector 保存 object、property 以及重新绘制 object 的指令或方程。
Drawing object
用公式或绘图指令定义的一个 shape 或图像组成部分。
Property
关于某个 drawing object 的 attribute/data,例如 position、dimensions、fill colour 或 line weight。
Drawing list
所有 drawing objects 的列表,以及绘制每个 object 所需的 command、description、equation 和 properties。

怎样选择 bitmap 或 vector?

任务特点合适选择与理由
Photograph、连续阴影、大量自然细节Bitmap;可以记录每个 pixel 的 colour variation。
Logo、icon、diagram、simple shapesVector;objects 可重新计算并绘制。
需要大幅缩放Vector;can be resized without pixelation / loss of quality。
需要逐个修改图像组成部分Vector;individual objects and properties can be edited。
Stage 6

从 analogue sound 到 digital data

真实声音来自空气压力的连续变化。麦克风把它转换成随时间连续变化的 electrical signal,这就是 analogue data。电脑不能保存时间轴上的无限多个值,因此要在固定间隔测量波形。

Analogue waveform 红点是在 regular intervals 取得的 amplitude samples
Sampling 不是复制整条曲线,而是在 regular intervals 记录 amplitude。
Analogue wave→Measure amplitude regularly→Assign binary value→Store values in sequence
Sampling
在 regular intervals 测量 analogue waveform 的 amplitude。
Sampling rate
每秒钟取得的 samples 数量,单位通常是 Hz 或 kHz。
Sampling resolution
保存每一个 sample 使用的 bits 数量。
Digital data
只能取离散数值的 binary data;每个 sample 经过量化后成为一个 binary value。
Stage 7

Sampling rate 与 sampling resolution

提高 sampling rate

每秒测量更多次,samples 之间的 time gaps 变小。数字波形可以记录更多时间细节,因此更接近 analogue waveform;同时每秒需要保存更多 samples,所以 file size 增加。

Higher sampling rate → more samples per second / smaller time gaps → waveform closer to original → higher accuracy → larger file

提高 sampling resolution

每个 sample 使用更多 bits,就能表示更多 amplitude levels。例如 8 bits 有 256 个 levels,而 16 bits 有 65 536 个 levels。记录值可以更接近真实 amplitude,quantisation error 减小;但每个 sample 需要更多 bits,因此 file size 增加。

Higher sampling resolution → more bits per sample → more amplitude values → smaller quantisation error → higher accuracy → larger file
两个参数解决不同问题

Sampling rate 决定多久测量一次;sampling resolution 决定每次测量能有多精细。不要把二者的解释互换。

Stage 8

计算 sound file size

对未压缩的单声道声音,每秒有 sampling rate 个 samples,每个 sample 使用 sampling resolution bits,再乘以录音时间。

File size in bits = sampling rate × sampling resolution × duration in seconds × number of channels

例:50 kHz、16 bits、20 minutes

Sampling rate = 50 kHz = 50 000 samples per second Duration = 20 × 60 = 1200 seconds File size = 50 000 × 16 × 1200 = 960 000 000 bits = 120 000 000 bytes = 120 MB

若题目明确是 stereo,再乘以 2 channels。若没有说明多个 channels,本课程题目通常按题目给出的信息直接计算。

Final review

完成本章后的检查表

  • 我能区分 image resolution、screen resolution 和 colour depth。
  • 我能用三个得分点描述 bitmap image 如何 encoded。
  • 我能写出位图 file size 公式,并正确转换 bits、bytes、MB 与 KiB。
  • 我能用 more pixels / more bits per pixel 解释 quality 与 file size 的变化。
  • 我能解释 drawing object、property 和 drawing list。
  • 我能根据 photograph、logo、scaling 和 editing 的需要选择 bitmap 或 vector。
  • 我能描述 sampling,并区分 sampling rate 与 sampling resolution。
  • 我能用 quantisation error 和 waveform closer to the original 解释 accuracy。
  • 我能计算未压缩 sound file size。
下一步

进入 1.2 filtered practice,在不看本页的情况下完成更多真题。简答题按分值写独立句子,计算题保留 working 与单位。

本页练习输入会保存在当前浏览器的 local storage,不会上传到服务器。

课程依据:Cambridge International AS & A Level Computer Science 9618 syllabus for examination in 2026, section 1.2 Multimedia;以及页面标注的 2022–2025 Past Paper questions 与对应 Mark Schemes。

查看 Cambridge 官方 2026 syllabus