Digital Image Color Depth and Encoding Fundamentals

Binary Color Representation

  • Monochrome / Black-and-White Systems:
    • A binary system represents exactly two chromatic states: black and white.
    • The number of discrete states is calculated as 21=22^1 = 2.
    • Exactly 1 bit1\,\text{bit} per pixel is sufficient to encode whether a pixel is active or inactive (black or white).

Grayscale Tonal Encoding

  • Intermediate Levels of Gray:
    • Transitions between pure black and pure white occur through a finite set of intermediate shades (nuances or levels of gray).
    • The number of available gray levels is directly determined by the allocated bit depth.
    • An encoding of 4 bits4\,\text{bits} yields 24=162^4 = 16 possible tonal values, permitting intermediate steps between white and black.

The Additive RGB Color Model

  • Primary Color Components:

    • The current standard for digital color representation relies on additive color mixing using three primary components:
    • Red (R\text{R}
    • Green (G\text{G}
    • Blue (B\text{B}
  • Bit Depth per Channel:

    • Each elementary channel is allocated an individual depth of 8 bits8\,\text{bits}.
    • An 8 bit8\,\text{bit} depth provides 28=2562^8 = 256 discrete intensity levels per channel.
    • Intensity values for each channel range numerically from 00 (minimum intensity / off) to 255255 (maximum saturation).

Combinatorial Color Depth and Image Size

  • Pixel Composition:

    • A single full-color pixel combines the values of all three elementary channels:
    • Pixel=Red+Green+Blue\text{Pixel} = \text{Red} + \text{Green} + \text{Blue}
    • Channel-by-channel bit breakdown:
    • Red channel: 8 bits8\,\text{bits} (28=256 possibilities2^8 = 256\,\text{possibilities}
    • Green channel: 8 bits8\,\text{bits} (28=256 possibilities2^8 = 256\,\text{possibilities}
    • Blue channel: 8 bits8\,\text{bits} (28=256 possibilities2^8 = 256\,\text{possibilities}
  • Total Bit Depth:

    • The total number of bits per pixel is the sum of the channel bits:
    • 8 bits+8 bits+8 bits=24 bits8\,\text{bits} + 8\,\text{bits} + 8\,\text{bits} = 24\,\text{bits}
  • Total Color Combinations:

    • The total number of unique colors reproducible by the RGB model is calculated as:
    • Total Colors=256×256×256=2563\text{Total Colors} = 256 \times 256 \times 256 = 256^3
    • Expressed in powers of two:
    • 28×28×28=28+8+8=2242^8 \times 2^8 \times 2^8 = 2^{8 + 8 + 8} = 2^{24}
    • Evaluating the total combinations:
    • 224=16 777 2162^{24} = 16\,777\,216
    • This yields approximately 16 M16\,\text{M} (16 million) unique color variations.
  • Image Storage Impact:

    • Uncompressed final image data size is directly proportional to the total pixel count multiplied by the 24 bits24\,\text{bits} (or 3 bytes3\,\text{bytes}) required for each RGB pixel.

Hexadecimal Color Notation

  • Purpose and Simplification:

    • Hexadecimal (base-16) notation is utilized to compress and simplify the human-readable representation of 24 bit24\,\text{bit} binary values.
    • Instead of writing out a continuous string of 2424 binary digits, hexadecimal organizes values into compact alphanumeric pairs.
  • Mathematical Mapping:

    • The base relationship is established by the equation:
    • 256=162256 = 16^2
    • Because 162=25616^2 = 256, the entire dynamic range of a single 8 bit8\,\text{bit} channel (256256 possibilities, from 00 to 255255) is encoded using exactly 22 hexadecimal symbols.
  • Full Hexadecimal Color Code:

    • An entire 24 bit24\,\text{bit} RGB color is represented using a 6-symbol6\text{-symbol} hexadecimal code:
    • 2 symbols2\,\text{symbols} for the Red channel (8 bits8\,\text{bits}
    • 2 symbols2\,\text{symbols} for the Green channel (8 bits8\,\text{bits}
    • 2 symbols2\,\text{symbols} for the Blue channel (8 bits8\,\text{bits}
    • This structure forms the standard #RRGGBB\text{\#RRGGBB} format.