Bits and Bytes CS Thinking Example 3

Follow the full solution, then compare it with the other examples linked below.

Example 3

medium
An image is 800 ร— 600 pixels. Each pixel uses 24 bits (8 bits each for red, green, blue). What is the uncompressed file size in megabytes?

Solution

  1. 1
    Step 1: Total pixels = 800 ร— 600 = 480,000. Total bits = 480,000 ร— 24 = 11,520,000 bits.
  2. 2
    Step 2: Convert to bytes: 11,520,000 รท 8 = 1,440,000 bytes. Convert to MB: 1,440,000 รท 1,048,576 โ‰ˆ 1.37 MB.

Answer

Approximately 1.37 MB uncompressed.
Calculating file sizes from dimensions and bit depth is a practical application of bits and bytes. Compression techniques reduce actual file sizes well below this theoretical maximum.

About Bits and Bytes

A bit is a single binary digit (0 or 1), the smallest unit of digital data. A byte is a group of 8 bits that can represent 256 different values (0 to 255), enough to encode one text character. All digital storage and communication is measured in bits and bytes.

Learn more about Bits and Bytes โ†’

More Bits and Bytes Examples