Bits and Bytes CS Thinking Example 3
Follow the full solution, then compare it with the other examples linked below.
Example 3
mediumAn 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 Step 1: Total pixels = 800 ร 600 = 480,000. Total bits = 480,000 ร 24 = 11,520,000 bits.
- 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
Example 1 easy
How many different values can be represented with 3 bits? List all possible 3-bit binary patterns.
Example 2 mediumConvert between storage units: (a) How many bytes in 2 kilobytes? (b) A file is 3,145,728 bytes โ ho
Example 4 hardA colour system uses 4 bits per colour channel (red, green, blue). (a) How many shades can each chan