1.2 Data Storage

Show All Section Notes

Digital Images

1. The Bitmap Concept

Most images on a computer are stored as Bitmaps. A bitmap image is composed of a grid of tiny dots called Pixels (short for Picture Elements).

In a 1-bit image, 0 = White, 1 = Black.

2. Key Terminology

Pixel
The smallest addressable element of a digital image.
Resolution
The number of pixels that make up an image (Width × Height). Higher resolution means more detail but larger file size.
Color Depth (Bit Depth)
The number of bits used to represent the color of a single pixel.

3. Color Depth Calculations

The number of colors available is calculated by 2n, where n is the bit depth.

Bit Depth Colors Available Usage
1-bit $2^1 = 2$ Monochrome (Black/White)
8-bit $2^8 = 256$ Basic web graphics
24-bit $2^{24} \approx 16.7$ Million "True Color" (8 bits each for R, G, B)

4. Estimating Image File Size

The Formula:

File Size (bits) = Resolution (W × H) × Color Depth


Example: An image is 1000 pixels wide, 500 pixels high, and uses 24-bit color.
  • Pixels: $1000 \times 500 = 500,000$
  • Size in bits: $500,000 \times 24 = 12,000,000 \text{ bits}$
  • Size in MiB: $12,000,000 \div 8 \div 1024 \div 1024 \approx 1.43 \text{ MiB}$

5. Metadata

An image file doesn't just contain pixel data. It also contains Metadata (data about data).

⚠️ Exam Alert: If you increase the Resolution OR the Color Depth, the file size will increase. This means it will take longer to download/upload and require more storage space.