0% found this document useful (0 votes)
17 views

Color Models

The document discusses different color models including RGB, HSV, and HSI. It explains how RGB represents colors using intensities of red, green and blue. It also describes how HSV and HSI represent colors using hue, saturation and value/intensity. Conversion between RGB, HSV and HSI models is discussed.

Uploaded by

Rakshit Sharma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views

Color Models

The document discusses different color models including RGB, HSV, and HSI. It explains how RGB represents colors using intensities of red, green and blue. It also describes how HSV and HSI represent colors using hue, saturation and value/intensity. Conversion between RGB, HSV and HSI models is discussed.

Uploaded by

Rakshit Sharma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Color Models

A color image is composed of three gray scale images for the three primary colors red, green and blue:

Based on the discussion on color perception, we know that a color can always be specified by three variables. But representing
a color image by the three primary colors is not necessarily the most convenient way to do color image processing. Sometimes
a different set of three variables, such as hue, saturation, and value (or intensity).

RGB/YCM model

The red, green and blue are used as the three primary colors which span a 3D space. The intensities of these primaries
are calibrated to range from 0 to 1 so that all possible colors that can be produced by these primaries are located inside
the cube as shown below:
Each side of the RGB cube is 1 with its eight vertices located at (black), (red), (green),

(blue), (yellow) (magenta), (cyan), (white). The length of the

diagonal is .

The RGB plane shown in the figure can be specified by the equation

An RGB triangle is formed by the three vertices , , and . In particular,

note the following measurements on the triangle:


The center point of the triangle is .

The lengths of its three sides are .

The distance from the center to any of the vertices is .


The distance from the center to the closet side is .

The length of the line from a vertex to the middle of the opposing edge is .

This cross section has the shape of a hexagon with highly saturated hues along its sides (e.g., red, yellow, green, cyan,
blue, and magenta in the middle part of the six sides, respectively), Also we see that the closer a color is to the line of
grays, the less saturated it becomes. The third variable intensity is not represented in this cross section.

The YCM plane is specified by the equation

with the center at . Note that in this color cube, the primaries RGB are not on the same plane as the

secondary primaries YCM.

Additive and subtractive colors

The primary colors R,G,B are additive colors used to describe the mixture of lights. In the background of black color (no
light), the light corresponding to each of these primary colors will give us the color sensation of red, green or blue.
Moreover, the mixture of any two of the three primary colors will give use the color sensation of yellow (R+G), magenta
(R+B) and cyan (B+G). Finally the mixture of all three primaries (R+G+B) will give us the sensation of white color.

and

Note that here addition means mixture of lights.

The secondary colors Y,C,M are subtractive colors used to describe the mixture of pigments or paints. In the background
of white color (white paper), the pigments corresponding to each of Y, C, M will absorb one primary color: cyan absorbs
(subtracts) red (C=W-R), magenta absorbs (subtracts) green (M=W-G), and yellow absorbs (subtracts) blue (Y=W-B).
Moreover, the mixture of pigments of two secondary colors will also absorb more colors: mixture of C and M appears
blue as both R and G are absorbed (W-R-G=B), mixture of C and Y appears green as both R and B are absorbed (W-R-
B=G), and mixture of Y and M appears red as both Y and G are absorbed (W-Y-G=R). Finally, the mixture of all three
secondaries appears black as all R, G and B are absorbed.
Note that here addition means mixture of pigments.

The HSV/HSI model

Alternatively, a color can be specified by a set of three different variables: the Hue (H), Saturation (S), and value (V) or
intensity (I).

These two models are called HSV and HSI models, respectively. Any color is represented by a 3D point in the solid, with
its hue represented by the angle with respect to red, its value or intensity represented by the vertical distance from zero
representing black, and its saturation represented by the horizontal distance to the closest side.

The Cone Models

The hue, saturation and intensity of colors can also be represented by a similar model as shown below:
A horizontal cross section going through the middle of the cone is shown here:

Two perpendicular vertical cross sections cutting through center of the cone are also shown:

Refernce: http://fourier.eng.hmc.edu/e161/lectures/color_processing/
for more :- http://www.UandiStar.org

procedure for conversion from RGB color model to


HSI color model.
Given an image in RGB color format, the H component of each RGB pixel is obtained
using the equation

(1)

With

(2)

The saturation component is given by

(3)

Finally, the intensity component is given by

It is assumed that the RGB values have been normalized to the range [0, 1] and
that angle
θ is measured with respect to the red axis of the HST space. Hue can be normalized to
the range [0, 1] by dividing by 360° all values resulting from Eq. (1). The other two
HSI components
already are in this range if the given RGB values are in the interval [0, 1].

GRIET/ECE 6

100% free SMS:- ON<space>UandiStar to 9870807070 for JNTU, Job Alerts, Tech News , GK News directly to ur Mobile
for more :- http://www.UandiStar.org

procedure for conversion from HSI color model to


RGB color model.
Given values of HSI in the interval [0,1 ], one can find the corresponding RGB values in
the same range. The applicable equations depend on the values of H. There are three sectors of
interest, corresponding to the 120° intervals in the separation of primaries.\

RG sector (0o ≤ H <120°):

When H is in this sector, the RGB components are given by the equations

B = I (1 – S)

G = 3 I – (R + B)

R = I [1 + (S * cos H/ cos(60o – H)]

GB sector (120o ≤ H < 240o):

If the given value of H is in this sector, first subtract 120° from it.

H = H - 1200

Then the RGB components are

R = I (1 – S)

B = 3 I – (R + G)

G = I [1 + (S * cos H/ cos(60o – H)]

BR sector (240o ≤ H ≤ 360o):

If H is in this range, subtract 240o from it

H = H - 2400

Then the RGB components are

G = I (1 – S)

GRIET/ECE 7

100% free SMS:- ON<space>UandiStar to 9870807070 for JNTU, Job Alerts, Tech News , GK News directly to ur Mobile

You might also like