Next: Color processing examples Up: color_processing Previous: Conversion from RGB to

# Conversion from HSI to RGB

Given , and , we can first find , , and on the RGB triangle, and the find , , and . Consider three possible cases in terms of the hue angle :

• ( and , i.e., inside )

From , solving for we get

To find , consider the triangle :

Here vector is the projection of vector onto the line , and all points , , and are on the RGB triangle. Now consider the following steps:

• On the triangle , we have

and

(* and )
• The length of is , and the saturation is , i.e., , we have:

and we get

• As , i.e., , and also , we have

Substituting this into the expression of above, we get:

• Finally we can get

Given and , we can get :

• (p inside )

• (p inside )

In summary, given the H, S, and I values, we can obtain the R, G, and B components by

and

Note that after the HSI to RGB conversion, we need to convert the R, G, and B values from the range of back to the three components for a pixel in a color image in the range of .

Next: Color processing examples Up: color_processing Previous: Conversion from RGB to
Ruye Wang 2016-10-06