optional · CSS study notes
Grayscale, Color Images, and Color Models
CSS Optional — Paper-II, Section-B · P-II.V.VII · Syllabus: Gray-scale and Color Images; Color Models (RGB, CMYK and HSI) ("HIS" in the syllabus = HSI). Asked in 2019 (RGB vs HSI) and 2021 (need for multiple colour models; CMY vs CMYK) — second only to histograms in frequency.
1. Grayscale vs Colour Images
| Feature | Grayscale | Colour (RGB) |
|---|---|---|
| Channels | 1 (intensity only) | 3 (R, G, B) |
| Bits per pixel | 8 typical (256 shades) | 24 typical (≈ 16.7 million colours) |
| Storage for M × N | M·N bytes | 3·M·N bytes |
| Uses | X-rays, documents, most classical DIP algorithms | Photography, displays, colour-based segmentation |
Colour → grayscale (luminance, weighted by eye sensitivity): Y = 0.299R + 0.587G + 0.114B. Green gets the highest weight because the eye is most sensitive to it; a plain average (R+G+B)/3 looks less natural.
Pseudo-colour (false colour): assigning colours to gray levels to make detail visible (thermal images, weather maps, X-ray baggage scanners) — different from true colour.
2. Colour Fundamentals
- The eye has three types of cones sensitive roughly to red, green and blue (≈ 65%, 33%, 2% of cones). All perceived colours are combinations of these responses — hence three primaries.
- Colour is described by brightness (intensity), hue (dominant wavelength — "which colour") and saturation (purity — how much white is mixed in). Hue + saturation together = chromaticity.
- Additive mixing (light): R + G + B = white; used by emitters (screens, projectors).
- Subtractive mixing (pigment): each ink absorbs its complement; C + M + Y ≈ black; used by printers.
3. RGB Model
- Additive, hardware-oriented; each colour is a point in a unit cube with black at (0,0,0), white at (1,1,1) and the grey scale along the main diagonal.
- Used by monitors, cameras, scanners, TVs.
- Limitations: not intuitive for humans ("how much blue makes this orange warmer?"); R, G and B are highly correlated, so brightness changes affect all three.
4. CMY and CMYK Models
- Subtractive, used for printing. Cyan absorbs red, magenta absorbs green, yellow absorbs blue.
- Conversion (normalized): C = 1 − R, M = 1 − G, Y = 1 − B.
- Why add K (black)? Equal C + M + Y inks give a muddy dark brown, not true black. Adding black ink gives: true, deep black; sharper black text; lower ink cost (one ink instead of three); faster drying and less paper soaking; fewer colour-registration problems.
- CMY → CMYK:
K = min(C, M, Y);C' = (C − K)/(1 − K),M' = (M − K)/(1 − K),Y' = (Y − K)/(1 − K)(if K = 1, the colour is pure black: C' = M' = Y' = 0).
CMY vs CMYK (CSS 2021):
| Point | CMY | CMYK |
|---|---|---|
| Inks | 3 (cyan, magenta, yellow) | 4 (adds black, "Key") |
| Black | Approximated by mixing — muddy brown | True black from K ink |
| Ink use / cost | Higher (three inks for dark areas) | Lower (black replaces the common grey component — "under-colour removal") |
| Text quality | Fuzzy black text (registration errors) | Crisp black text |
| Use | Theoretical model, some low-end printers | Industry standard for commercial printing |
5. HSI Model
- Perception-oriented: separates intensity (I) from colour information (H and S), matching how humans describe colour.
- Geometry: a double cone / cylinder — H is an angle (0° red, 120° green, 240° blue), S is distance from the central axis (0 = grey, 1 = pure), I is height along the axis (black → white).
- RGB → HSI (normalized R, G, B):
I = (R + G + B) / 3S = 1 − 3·min(R, G, B) / (R + G + B)θ = cos⁻¹{ ½[(R − G) + (R − B)] / √[(R − G)² + (R − B)(G − B)] }; H = θ if B ≤ G, else H = 360° − θ
- Why it matters for DIP: you can process intensity alone — e.g. histogram-equalize I without shifting hues — and segment by hue independently of lighting.
RGB vs HSI (CSS 2019):
| Point | RGB | HSI |
|---|---|---|
| Orientation | Hardware (how devices produce colour) | Human perception (how people describe colour) |
| Components | Red, green, blue amounts | Hue, saturation, intensity |
| Geometry | Unit cube | Double cone / cylinder |
| Intensity | Mixed into all three channels | Isolated in one channel (I) |
| Enhancement | Equalizing R, G, B separately shifts colours | Equalize I only — colours preserved |
| Segmentation | Sensitive to lighting changes | Hue-based segmentation is robust to shadows/lighting |
| Computation | Native to hardware, no conversion | Needs non-linear (trigonometric) conversion; hue undefined for greys |
| Uses | Display, capture, storage | Colour image processing, vision, colour pickers |
6. Why More Than One Colour Model? (CSS 2021)
No single model suits every task: devices, printers and people "think" about colour differently.
| Model | Oriented to | Use |
|---|---|---|
| RGB | Emissive hardware | Monitors, cameras, scanners |
| CMY / CMYK | Reflective hardware | Printers, publishing |
| HSI / HSV / HSL | Human perception | Image processing, colour pickers in design software |
| YIQ / YUV / YCbCr | Transmission and compression | TV broadcasting, JPEG and MPEG (chroma subsampling) |
| CIE XYZ / Lab* | Device-independent, perceptually uniform | Colour management, accurate colour matching between devices |
7. Colour Image Processing — Two Approaches
- Per-channel: process R, G and B separately (fine for linear filtering, e.g. smoothing).
- Vector-based / intensity-based: treat each pixel as a vector or convert to HSI and work on I — needed for histogram equalization and edge detection to avoid colour distortion.
- Colour segmentation: in HSI, threshold on hue (and saturation); in RGB, use distance from a reference colour vector.
📐 Worked Numericals
N1 — RGB → CMY: orange RGB (255, 128, 0) → normalized (1, 0.502, 0) → CMY = (0, 0.498, 1).
N2 — RGB → CMYK: RGB (100, 50, 50).
- Normalize: R = 0.392, G = B = 0.196
- CMY: C = 0.608, M = Y = 0.804
- K = min = 0.608; 1 − K = 0.392
- C' = 0/0.392 = 0; M' = Y' = (0.804 − 0.608)/0.392 = 0.5
- CMYK = (0, 0.5, 0.5, 0.608)
N3 — RGB → HSI: normalized (0.6, 0.4, 0.2).
- I = 1.2/3 = 0.4
- S = 1 − 3(0.2)/1.2 = 0.5
- Numerator = ½[(0.2) + (0.4)] = 0.3; denominator = √[0.04 + (0.4)(0.2)] = √0.12 = 0.3464
- θ = cos⁻¹(0.866) = 30°; B (0.2) ≤ G (0.4) → H = 30° (an orange hue)
N4 — Grayscale conversion: RGB (200, 100, 50) → Y = 59.8 + 58.7 + 5.7 = 124.2 ≈ 124 (a plain average would give 116.7).
N5 — Colour count: 24-bit → 2^24 = 16,777,216 colours; 16-bit "high colour" (5-6-5 bits) → 65,536.
🎯 CSS Exam Angle
- RGB vs HSI: comparison table + one sentence on why HSI helps processing (intensity decoupled from colour) + the RGB → HSI formulas. A small cube and cone sketch earns quick marks.
- "Need for more than one model": the 5-row table in section 6 — the key idea is hardware-oriented vs perception-oriented vs transmission-oriented.
- CMY vs CMYK: table + the five reasons for adding K.
📌 Past CSS Paper Frequency
| Year | Question |
|---|---|
| 2019 | Compare RGB and HSI colour models in the context of digital image processing |
| 2021 | Is there a need for more than one colour model? Mention different colour models and their uses |
| 2021 | Explain the CMY colour model, its use, and how it differs from CMYK |
⚠️ MCQ Traps
- RGB is additive; CMY(K) is subtractive.
- K in CMYK stands for Key (black), not "blacK" or "Kelvin".
- Hue is an angle; saturation is purity; intensity is brightness.
- Hue is undefined when S = 0 (greys); saturation is undefined when I = 0 (black).
- Luminance weights green highest (0.587), blue lowest (0.114).
- Pseudo-colour is not true colour — it's a display mapping of gray levels.
- JPEG converts RGB to YCbCr, not HSI, before compression.
✅ Self-Check (with Answers)
Q1. Why is RGB called additive and CMY subtractive?
Ans: RGB adds emitted light — R + G + B = white (screens). CMY inks absorb (subtract) wavelengths from white light — cyan absorbs red, magenta absorbs green, yellow absorbs blue; C + M + Y ≈ black (printers).
Q2. Give three reasons for adding black (K) in CMYK.
Ans: Mixing C + M + Y gives a muddy brown, not true black; one black ink costs less than three coloured inks; black text is sharper (no colour-registration errors); less ink means faster drying and less paper soaking.
Q3. Convert normalized RGB (0.2, 0.4, 0.6) to CMY.
Ans: C = 1 − 0.2 = 0.8, M = 1 − 0.4 = 0.6, Y = 1 − 0.6 = 0.4.
Q4. Convert that CMY (0.8, 0.6, 0.4) to CMYK.
Ans: K = min = 0.4; 1 − K = 0.6. C' = 0.4/0.6 = 0.667, M' = 0.2/0.6 = 0.333, Y' = 0 → CMYK = (0.667, 0.333, 0, 0.4).
Q5. Why is HSI preferred for colour image processing?
Ans: It separates intensity from colour. Intensity can be enhanced alone without shifting colours, and objects can be segmented by hue regardless of shadows or lighting — which matches how humans describe colour.
Q6. Why does green get the largest weight (0.587) in grayscale conversion?
Ans: The eye is most sensitive to green wavelengths, so green contributes most to perceived brightness; blue contributes least (0.114).
Q7. Name a colour model used in JPEG compression and why.
Ans: YCbCr — it separates luminance (Y) from chrominance (Cb, Cr), so chroma can be subsampled heavily with little visible loss, since the eye is less sensitive to colour detail.
📜 Past-Paper Questions & MCQs (CSS 2016–2026)
2016 · Paper-II · Q7(b) and 2021 · Paper-II · Q7(c) · 6 marks each
Q. Differentiate between the CMY and CMYK colour models used in digital image processing. Explain the CMY colour model and its use.
Ans.
- CMY (cyan, magenta, yellow) is a subtractive model used for printing and plotting. Each ink absorbs (subtracts) part of the white light. The relation with RGB is C = 1 − R, M = 1 − G, Y = 1 − B. Mixing all three should give black.
- CMYK adds K (black, the "key") as a fourth ink.
| Basis | CMY | CMYK |
|---|---|---|
| Components | 3 inks | 4 inks (adds black) |
| Black produced | A muddy dark brown, because real inks are imperfect | A true, deep black |
| Ink cost and drying | Three inks overlap, so more ink and slower drying | Black ink replaces the equal CMY mix, so it is cheaper and sharper (text) |
| Use | Theory and simple colour conversion | Professional printing |
2019 · Paper-II · Q6(b) · 6 marks
Q. Compare the RGB and HSI colour models in the context of digital image processing.
Ans.
| Basis | RGB | HSI |
|---|---|---|
| Components | Red, Green, Blue intensities | Hue (colour type), Saturation (purity), Intensity (brightness) |
| Basis | Hardware oriented (monitors, cameras) | Matches how humans describe colour |
| Brightness | Mixed into all three channels | Separate (I channel), so colour and brightness are decoupled |
| Best for | Display, capture, storage | Colour-based segmentation and enhancement (process I without changing colours) |
2020 · Paper-II · Q7(b) · 8 marks and 2021 · Paper-II · Q7(b) · 6 marks
Q. Explain the types of colour models, and the most common hardware-oriented colour models in detail. Is there a need for more than one colour model?
Ans.
- A colour model is a coordinate system that represents each colour as a numeric tuple.
- Hardware-oriented models:
- RGB: additive, for monitors, TVs, cameras and scanners. Colours are formed by adding light (a cube with black at the origin and white at the opposite corner).
- CMY / CMYK: subtractive, for printers.
- YIQ / YUV / YCbCr: luminance plus colour difference, for TV broadcasting and JPEG, which allows chroma subsampling.
- Perception-oriented models: HSI, HSV, HSL describe colour as hue, saturation and intensity or value.
- Need for more than one: different devices and tasks work in different spaces. Displays need RGB, printers need CMYK, compression and TV need luma/chroma, and segmentation or enhancement is easier in HSI. Conversions are used between them.
2022 · Paper-II · Q6(b) · 8 marks
Q. The R, G and B component images of an RGB image have the horizontal intensity profiles shown (red falls linearly from 1.0 to 0 across the width, green rises from 0 to 1.0 at the middle and falls back to 0, blue rises linearly from 0 to 1.0). Identify the colour a person would see in the middle column.
Ans.
- At the middle column (position N/2):
- Red = 0.5 (halfway down its linear fall)
- Green = 1.0 (the peak)
- Blue = 0.5 (halfway up its linear rise)
- Colour = (R, G, B) = (0.5, 1.0, 0.5), which is a light (pale) green: green at full strength, with equal red and blue added, which lightens it towards white.
MCQs
2024 P-II · Q15. Which of the following is true?
- (A) Brightness gives a measure of the degree to which a pure colour is diluted by white light
- (B) Saturation gives a measure of the degree to which a pure colour is diluted by white light ✅
- (C) Hue gives a measure of the degree to which a pure colour is diluted by white light
- (D) None of these
- Answer: (B).
- Why: saturation is the purity of a colour (red is highly saturated, pink is red diluted with white). Hue is the colour type (red, green, blue), and brightness (intensity) is how light or dark it is.