top of page
  • Writer's pictureSunil Kumar Yadav

What are Color Spaces?



Color spaces are a method of representing the colors in an image in a different way. Color space is a useful conceptual tool for understanding the color capabilities of a particular device or digital file. When trying to reproduce color on another device, color spaces can show whether you will be able to retain shadow/highlight detail, color saturation, and by how much either will be compromised.


1931 Chromacity Digaram.
Image 1. Chromacity Diagram (1931)

Color spaces are a method of representing the colors in an image in a different way. For example, a lot of high definition video uses YCbCr color space. Whereas RGB color space is used by computer monitors and by the time the colors get to a printer, it'll be in CMYK format, because that's the format printers understand. Hence the color of ink used in printers is Cyan, Magenta, Yellow, and Black (Key).


The image on the left is 1931's Chromacity diagram which represents all the human observable visible spectrum in the form of a graph. The exact wavelength of each color is marked in the graph which ranges from 380 nm to 650 nm. Depending upon color space all the human visible colors are mapped to respective color models.


KYC: Know Your Color Space

Representing human-perceivable all possible color values accurately is a costly and wasteful affair. As a human, we don't encounter super-saturated color that often. Hence products which we use like TV or camera are calibrated to work on a small subset of the chromaticity diagram. Every color value of a pixel in an image is calculated as per the color space coordinate in the chromaticity diagram. Hence it becomes essential to transforming the coordinates values of color space A correctly to color space B to visualize color details correctly.


Image 2. Different color space and its impact

For example, as a content creator, you are using SONY's digital camera to record some video and its default color space is S-Gamut3.Cine and you tried to upload it over youtube which uses Rec.709 as color space. If you do not know source and destination color spaces then you won't be able to figure out why your video color quality is so poor. Below is the example if you upload S-Gamut3.Cine color space video to the system with Rec.709 color space.


Image 3: Change in image quality without color space transformation

To fix this color quality issue, one has to transform input S-Gamut3.Cine to Rec.709 using media editing tool. Below is the image after transforming source color space to target color space.


Image 4: Image quality with color space transformation

Difference between color space and color model

A color model is a mathematical (or computer science) way of describing colors. It is independent of physical devices. For example, RGB-8, RGB-16, CYMK, HSV are a few examples of color models. Whereas a color space is the method of mapping real colors to the color model's discrete values. Many a time these terms are used interchangeably and but we should understand the difference between the two. For sake of simplicity, we'll use them interchangeably. Let's have a quick look at a few of the color models used in the field of image processing.


RGB

RGB stands for Red, Green, and Blue. The RGB color model is an additive color model in which the red, green, and blue primary colors of light are added together in various ways to reproduce a broad array of colors. All the pixels in RGB-8 image have red, green, and blue component whose values ranges fro 0-255 each.

Image 5: RGB color model

CMYK

CMYK stands for cyan, magenta, yellow, and key (black). The CMYK color model is a subtractive color model i.e more we add these components darker (K) final color becomes.


Image 6: CMYK color model

YCbCr

YCbCr and its variants are used in TV broadcasting. For example, PAL uses YCbCr colorspace and NTSC uses similar color space but slightly different. YCbCr separates the luminosity of an image of all pixels and then using this one can do a lot of clever things like downsampling color etc. So Y represents the intensity or brightness of each pixel and Cb represents the blueness chrominance of each pixel and Cr redness chrominance value. Value of Y range from 0-255 and Cb and Cr range from -127-128.


Image 7: YCbCr color model

HSV

HSV stands for Hue, Saturation, and Value(Brightness), and this color model is used extensively in the image processing field. The HSV color wheel sometimes appears as a cone or cylinder. Hue is the color portion of the model, expressed as a number from 0 to 360 degrees. Saturation describes the amount of gray in a particular color, from 0 to 100 percent. Reducing this component toward zero introduces more gray and produces a faded effect. Value works in conjunction with saturation and describes the brightness or intensity of the color, from 0 to 100 percent, where 0 is completely black, and 100 is the brightest and reveals the most color. Sometimes saturation and value are represented by 0-255 range where 0 represent completely black and 255 bright.


Image 8: HSV color model




93 views0 comments

Recent Posts

See All

Comentários


bottom of page