Binary Mapping: Color depth (or bit depth) is the number of bits used to represent the color of a single pixel. The more bits available, the more unique binary combinations can be created, allowing for a wider range of colors.
The Power of Two Rule: The number of colors an image can display is calculated using the formula , where is the color depth. For example, a 1-bit image supports 2 colors (), while an 8-bit image supports 256 colors ().
True Color: Modern high-quality images often use a 24-bit color depth, providing over 16.7 million colors. This is achieved by allocating 8 bits each to the Red, Green, and Blue channels, allowing for photorealistic gradients.
The Fundamental Formula: To find the total number of bits required to store an uncompressed image, multiply the width by the height and then by the color depth:
Converting to Bytes: Since storage is usually measured in bytes, the total bit count must be divided by 8. Further conversions to Kibibytes (KiB) or Mebibytes (MiB) require dividing by 1024 at each step.
Storage Requirements: Increasing either the resolution or the color depth will linearly increase the file size. For instance, doubling the width and height of an image actually quadruples the total pixel count and the resulting file size.
| Feature | Bitmap (Raster) | Vector |
|---|---|---|
| Composition | Grid of individual pixels | Mathematical equations and paths |
| Scalability | Loses quality (pixelates) when enlarged | Infinitely scalable without quality loss |
| File Size | Depends on resolution and color depth | Depends on the complexity of shapes |
| Best Use | Photographs and complex shading | Logos, icons, and typography |
Check the Units: Always verify if the question asks for the answer in bits, bytes, KB, or MB. Forgetting to divide by 8 to get bytes is the most common source of lost marks.
The Relationship: Memorize the powers of 2 (2, 4, 8, 16, 32, 64, 128, 256). If a question asks how many bits are needed for 50 colors, you must round up to the next power of 2 (), so 6 bits are required.
Metadata Identification: If asked to identify metadata, distinguish between 'internal' data needed for display (resolution) and 'external' data for context (GPS, Author).
Sanity Check: If you calculate a file size for a small icon and get several Gigabytes, re-check your multiplication and unit conversions immediately.