Multimedia & Machine Learning Algorithms · Multimedia Algorithms
Color Spaces & Image Representation — RGB, YCbCr, and HSV
Explanation
Digital Image Representation — Intuition
A digital image is a matrix of pixels. Each pixel encodes color as numbers. But "color" can be described in different ways — each way is a different color space. The choice of color space dramatically affects compression, processing, and display.
RGB Color Space
RGB represents each pixel as a triple — amounts of Red, Green, and Blue. In 8-bit-per-channel format:
- Each channel value: – ( levels)
- Bits per pixel: bits
- Number of colors: million
Raw (uncompressed) file size: for a pixel image:
YCbCr Color Space — Separating Luminance from Color
The human visual system is more sensitive to brightness than to color detail. YCbCr exploits this:
- Y (Luma / Luminance): pixel brightness
- Cb: blue-difference chroma component
- Cr: red-difference chroma component
Note that the Y coefficients sum to one: , so for a white pixel we get — correct. ✓
Advantage: The Cb and Cr channels can be sampled at lower density than Y without perceptible quality loss — a process called chroma subsampling.
4:2:0 Subsampling: For every pixel block, 4 Y values are stored but only 1 Cb and 1 Cr value — less than half the data:
HSV Color Space
HSV describes color in a more intuitive language for designers:
- H (Hue): color tone — angle on the color wheel, –
- S (Saturation): how "pure" vs. gray the color is, –
- V (Value): brightness, –
HSV is useful for filtering by color (Hue) while being robust to varying illumination.
Interactive Visualization
Loading visualization
Worked Examples
Practice
Exercise 1 of 6
1
An RGB image with 8 bits per channel — how many bits in total per pixel?
★Quiz
Test your knowledge from this lesson
A mix of questions from the lesson — each attempt varies slightly
Answer at least 4 out of 5 questions correctly to pass (70%)