Color spaces for histology: Gonzalez & Woods describe RGB as a perceptually nonlinear space that is "inherently difficult for humans to reason about because not related to natural colour perception." Raw RGB values don't directly correspond to stain concentrations because the relationship between absorption and detected intensity is logarithmic (Beer-Lambert law). Converting to optical density (OD = −log(I/I₀)) linearizes this relationship, making stain separation a simple linear algebra problem.
Beer-Lambert law: Pawley explains contrast formation in transmitted light microscopy through absorption: I_transmitted = I₀ × e^(−εcl), where ε is the extinction coefficient, c is the concentration, and l is the path length (section thickness). In OD space: OD = εcl. This linearity means that doubling the stain concentration doubles the OD — a property that is essential for quantitative analysis. In the RGB domain, the same doubling has a nonlinear effect.
Why three stains maximum: Standard RGB imaging captures three channels (red, green, blue). Color deconvolution with three stain vectors requires inverting a 3×3 matrix — exactly solvable. With more than three stains, the system becomes underdetermined in standard RGB. This is why H&E (2 stains + residual), H-DAB (2 stains + residual), and Masson's trichrome (3 stains) are naturally suited to RGB color deconvolution. Multiplex IHC with more than 3 chromogens requires multispectral imaging (more channels) rather than standard RGB.
HSV alternative: Solomon & Breckon note that HSV color space "allows separation of colour from lighting." For some applications, converting to HSV and analyzing the hue channel provides a simpler (if less rigorous) stain separation — hue distinguishes blue (hematoxylin) from brown (DAB) regardless of staining intensity. However, this approach doesn't provide quantitative stain concentrations and breaks down when stains have similar hues.
Stain absorption follows the Beer-Lambert law: the amount of light absorbed is proportional to the amount of stain present. Converting from RGB to optical density linearizes this relationship, making stain separation straightforward linear algebra. Standard RGB cameras can cleanly separate up to 3 stains; multiplex chromogen panels with more stains need multispectral cameras.