Join thousands of AI enthusiasts and experts at the Learn AI Community.


Color Theory in Computer Vision
Computer Vision

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.

Photo by Paweł Czerwiński on Unsplash

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.


  • 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


L -Lightness ( Intensity)

a -Green to Magenta

b -Blue to Yellow

Convert RGB to LAB using SkImage


Y-Luminance , Cr -Red, Cb -Blue

  • Resemblance with YUV mode

Convert RGB to YCrCb using SkImage



Convert RGB to XYZ using SkImage



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:

Akula Hemanth Kumar – Medium

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

Feedback ↓