Color Theory in Computer Vision
Last Updated on January 6, 2023 by Editorial Team
Author(s): Akula Hemanth Kumar
Computer Vision
Making computer vision easy with Monk, a low code Deep Learning tool, and a unified wrapper for Computer Vision.
Color Vision

History of Color theory:
Color model from the book “Theory of Colors” by Johann Wolfgang.

RYB colors
Proof as to why RYB was Considered to be primary colors

Trichromatic Theory
- Also known as Young-Helmholtz theory.
Three types of cone photoreceptors
- Short-preferring(Blue)
- Middle-preferring(Green)
- Long-preferring(Red)

RGB Space Spanning

Opponent color theory
- There are colors not directly perceivable in normal lighting conditions.
- The trichromatic theory fails to incorporate these colors.
- The opponent-process works through excitatory and inhibitory responses, with the two components of each mechanism opposing each other.
Gray Scale
- Monochromatic Single Channel
- Pixel values from 0(Black) to 255(White)
- Grayscale images contain only shades of gray.
Use cases
- Less data complexity and storage requirements
- Many applications work well with gray scales. Complex channels are not required.
- Improved computation speeds.
RGB
- The additive color space is based on the RGB color model.
- Three Channels Red, Green, and Blue.
- Used in many image processing and computer vision applications.

Accessing channels of RGB image using OpenCV

Additive and Subtractive Color Theory

Convert RGB to CMYK using PIL

CIE -LAB
L -Lightness ( Intensity)
a -Green to Magenta
b -Blue to Yellow
Convert RGB to LAB using SkImage

CIE-YCrCb
Y-Luminance , Cr -Red, Cb -Blue
- Resemblance with YUV mode
Convert RGB to YCrCb using SkImage

CIE-XYZ
Convert RGB to XYZ using SkImage

HSV
Convert RGB to HSV using Skimage

Other Color Spaces
- Haematoxylin-Eosin-DAB(HED)
- CIE-LCH color space
- YUV color space
- YIQ color space
- Stain color space
- HSL color space
You can find the complete jupyter notebook here.
If you have any questions, you can reach Abhishek. Feel free to reach out to him.
I am extremely passionate about computer vision and deep learning. I am an open-source contributor to Monk Libraries.
You can also see my other writings at:
Color Theory in Computer Vision was originally published in Towards AI on Medium, where people are continuing the conversation by highlighting and responding to this story.
Published via Towards AI
Towards AI Academy
We Build Enterprise-Grade AI. We'll Teach You to Master It Too.
15 engineers. 100,000+ students. Towards AI Academy teaches what actually survives production.
Start free — no commitment:
→ 6-Day Agentic AI Engineering Email Guide — one practical lesson per day
→ Agents Architecture Cheatsheet — 3 years of architecture decisions in 6 pages
Our courses:
→ AI Engineering Certification — 90+ lessons from project selection to deployed product. The most comprehensive practical LLM course out there.
→ Agent Engineering Course — Hands on with production agent architectures, memory, routing, and eval frameworks — built from real enterprise engagements.
→ AI for Work — Understand, evaluate, and apply AI for complex work tasks.
Note: Article content contains the views of the contributing authors and not Towards AI.