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
Take our 90+ lesson From Beginner to Advanced LLM Developer Certification: From choosing a project to deploying a working product this is the most comprehensive and practical LLM course out there!
Towards AI has published Building LLMs for Production—our 470+ page guide to mastering LLMs with practical projects and expert insights!

Discover Your Dream AI Career at Towards AI Jobs
Towards AI has built a jobs board tailored specifically to Machine Learning and Data Science Jobs and Skills. Our software searches for live AI jobs each hour, labels and categorises them and makes them easily searchable. Explore over 40,000 live jobs today with Towards AI Jobs!
Note: Content contains the views of the contributing authors and not Towards AI.