Multimedia Digitization

Bitmaps, Audio, and Compression

Created by Sam Li

What is Digitization?

Computers only understand binary data (0s and 1s). However, the real world is analog—continuous and infinite. For example, a violin string vibrates continuously, and a painted canvas has infinite variations of color. Digitization is the process of converting these continuous analog signals into discrete, finite digital numbers that a computer can store and process.

The Two Core Steps of Digitization

1

Sampling

Taking snapshots or measurements of the analog signal at regular intervals. This breaks a continuous signal into discrete pieces.

  • Audio: Measuring sound waves over time (e.g., taking 44,100 measurements every second).
  • Images: Dividing a picture into a grid of pixels over space.
2

Quantization

Assigning a specific, discrete numerical value to each sample based on available bits. This rounds exact values to the nearest available step.

  • Audio: Rounding the exact sound wave amplitude to the nearest available level (Bit Depth).
  • Images: Assigning a specific binary code for a color out of a limited palette (Color Depth).
Rule of Bits: n bits can represent 2n different patterns or levels. (e.g., 8 bits = 28 = 256 levels).

Think & Discuss: Information Loss

Since we are only taking "snapshots" (sampling) and "rounding off" values (quantization), is the digital version exactly the same as the original analog signal? What happens if we sample too slowly, or use too few bits for quantization?

Let's explore the next tabs (Audio & Image) to see the visual effects of changing these settings!

Audio Digitization

Sound travels as continuous waves of air pressure. To store sound on a computer, we must measure the height (amplitude) of the wave at regular time intervals.

20 Hz

How often we take a snapshot per second (Horizontal axis). Higher rate = captures faster changes in sound.

Low (Fewer slices) High (More slices)
10 Levels

How many exact values are available to record the height (Vertical axis). Higher depth = more accurate volume levels.

Low (Rough steps) High (Smooth steps)
Original Analog Wave
Digital Samples

Student FAQ: Why not just set everything to maximum?

If higher sampling rates and bit depths make the digital wave look exactly like the original analog wave, why don't we just use infinite rates and depths to get perfect quality?

Answer: File Size! Every sample takes up bits. Higher rates = more samples per second. Higher bit depth = more bits used per sample. This leads to massive file sizes. We must find a balance between Quality and Storage Space.

Image Digitization

A real-world scene is continuous in space and color. To digitize an image, we place a grid over it (Sampling) and assign a single color value to each square, called a Pixel (Picture Element).

32 x 32

Determines how many pixels make up the image (Spatial Sampling). More pixels = finer detail.

Low (Pixelated) High (Clear)

What about Quantization?

In images, quantization is called Color Depth (Bit Depth). It determines how many bits are used to represent the color of a single pixel.

1-bit = 21 = 2 colors (Black & White)
8-bit = 28 = 256 colors
24-bit = 224 = 16.7 million colors (True Color)

Procedurally generated gradient circle showing pixelation

Think & Discuss: Calculating the Cost of Quality

Imagine a modern smartphone photo. It might have a resolution of 4000 x 3000 pixels, and use 24-bit True Color. How many total bits is that?

Let's head over to the "File Size Calculator" tab to find out exactly how to calculate this mathematically!

File Size Calculator

Every digital sample requires bits to store. We can mathematically calculate the exact size of uncompressed raw data using simple formulas.

Bitmap Image Size

Size = Width × Height × Color Depth
Uncompressed Size
5.93 MB
49,766,400 bits

Audio File Size

Size = Rate × Depth × Channels × Time
Uncompressed Size
10.09 MB
84,672,000 bits
Note on Units: The formulas calculate the total number of bits. To convert to Bytes, divide by 8. To convert to Kilobytes (KB), divide by 1024. To convert to Megabytes (MB), divide by 1024 again.
8 bits = 1 Byte (B)  |  1024 B = 1 KB  |  1024 KB = 1 MB

Think & Discuss: The Storage Problem

A single 3-minute song uncompressed is over 30 MB. A 4K movie uncompressed would be hundreds of Gigabytes! How do streaming services like Netflix or Spotify manage to send this over the internet without using all your data?

The answer lies in the "File Formats" tab. Let's learn about Compression!

File Formats & Compression

As seen in the calculator, uncompressed files (like BMP or WAV) are massive! To make files easier to store and download, we use Compression Algorithms. Different file formats use different types of compression.

Lossless Compression

Reduces file size by finding mathematical patterns, without losing any original data. When uncompressed, the file is 100% identical to the original.

Pros & Cons

  • Perfect quality retained
  • File size is still relatively large

Common Formats

PNG GIF FLAC ZIP

Lossy Compression

Reduces file size by permanently discarding data that human eyes or ears are less likely to notice. The uncompressed file is an approximation of the original.

Pros & Cons

  • Massive reduction in file size (great for web/streaming)
  • Quality degrades, especially if re-saved multiple times

Common Formats

JPG / JPEG MP3 AAC MP4
What about Uncompressed Formats? Formats like BMP (Bitmap Images) and WAV (Waveform Audio) do not use compression. They store the raw data exactly as calculated in the previous tab. They offer the highest quality but take up the most disk space.

Think & Discuss: Making the Right Choice

If you are a professional photographer printing a huge billboard, which format type would you choose? What if you are a web designer creating a fast-loading website?

Conclusion: There is no "perfect" format. We must always balance Quality, File Size, and Purpose!