What is the difference between HSI and HSV color space? I want to use HSI color space but I did not find any useful material for HSI. Is HSI the same as HSV?
2 Answers
HSI, HSV, and HSL are all different color spaces. Hue computation is (as far as I can find) identical between the three models, and uses a 6-piece piece-wise function to determine it, or for a simpler model that is accurate to within 1.2 degrees, atan((sqrt(3)⋅(G-B))/2(R-G-B))
can be used. For the most part, these two are interchangeable, but generally HSV and HSL use the piece-wise model, where HSI usually uses the arctan model. Different equations may be used, but these usually sacrifice precision for either simplicity or faster computation.
For lightness/value/intensity, the three spaces use slightly different representations.
- Intensity is computed by simply averaging the RGB values:
(1/3)⋅(R+G+B)
. - Lightness averages the minimum and maximum values for RGB:
(1/2)⋅(max(R,G,B) + min(R,G,B))
. - Value is the simplest, being the value of the maximum of RGB:
max(R,G,B)
.
When used in subsequent calculations, L/V/I is scaled to a decimal between 0 and 1.
Saturation is where the three models differ the most. For all 3, if I/V/L is 0, then saturation is 0 (this is for black, so that its representation is unambiguous), and HSL additionally sets saturation to 0 if lightness is maximum (because for HSL maximum lightness means white).
- HSL and HSV account for both the minimum and maximum of RGB, taking the difference between the two:
max(R,G,B) - min(R,G,B)
, this value is sometimes referred to as chroma (C). - HSV then takes the chroma and divides it by the value to get the saturation:
C/V
. - HSL divides chroma by an expression taking lightness into account:
C/(1-abs(2L-1))
. - HSI doesn't use chroma explicitly, instead only taking
min(R,G,B)
into account:1 - min(R,G,B)/I
.
Sources
- Wikipedia: HSL and HSV
- Wikipedia: Hue
-
Thanks this is helpful. I wonder if the triangle model described in Smith's original paper from 1978 ("Color Gamut Transform Pairs", alvyray.com/Papers/CG/color78.pdf) actually describes the HSI model instead what is declared as the HSL model in the paper. Commented Sep 29, 2015 at 10:20
-
"Intensity is computed by simply averaging the RGB values: (1/3)(R+G+B). Intensity averages the minimum and maximum values for RGB: (1/2)(max(R,G,B) + min(R,G,B)). " - there seems to be something wrong as you wrote two times "Intesity". Commented Nov 27, 2015 at 9:26
-
You could give the formulas for converting RGB->HSI, RGB->HSV, RGB->HSL. This would make the difference more obvious. Commented Nov 27, 2015 at 9:27
-
1@moose Fixed the problem with Intensity being used twice, not sure how I didn't catch that originally. Also added escapes for the asterisks, so now it's not randomly italicized. The formulas given here are the conversion from RGB to the given system, just separated to each of the components. I'll add a recap/summary though to bring it all together though. Commented Dec 1, 2015 at 21:19
-
@MitchellCarroll Thank you. Would you mind if I changed the formatting a bit? This is mostly a subjective thing, but I think I have a good feeling for what many people like on StackExchange. Also, I would replace the asterisk
*
by a multiplication dot⋅
. Commented Dec 1, 2015 at 22:21
From the mathematical formula, the Hues are the same for HSV and HSI when you are trying to make the conversion from RGB to one of them.
Saturation in HSL is dependent on max
, min
, and Lightness, while HSV's Saturation is only max
and min
dependent. (max
and min
are the maximum and minimum pixel value among R, G, B space).
Value is max
while the Lightness is (max + min)/2