Next: Conversion from HSI to Up: color_processing Previous: The RGB Cube and

# Conversion from RGB to HSI

Given the intensities of the three primaries , , and of a color, we can find its HSV representation using different models. Here we use the RGB plane of the cube to find the corresponding HSV. The three vertices are represented by , and , and the three components of the given color is represented by a point in the RGB 3-D space. As we assume the intensities are normalized so that the , and values are between 0 and 1, so that point is inside or on the surface of the color cube.

• Determine the intensity :

The intensity can be defined as:

• Determine the hue :

First find the intersection of the color vector with the RGB plane (triangle) :

This point is on the RGB triangle as . The hue is the angle formed by the vectors and . Consider the dot product of these two vectors:

where , , and , and

We assume ; i.e., , and find the hue angle to be:

where

Substituting, we get the hue angle:

If , then .

• Determine S:

The saturation of the colors on any of the three edges of the RGB triangle is defined as 1 (100% saturated), and the saturation of is zero. Denote as the intersection of the extension of line with the edge. If the normalized color is , , and if , . The saturation of any color point between and is defined as

Here it is assumed that point is inside the triangle so that . In general

Next: Conversion from HSI to Up: color_processing Previous: The RGB Cube and
Ruye Wang 2012-09-25