HSI and HSV color space

后端 未结 2 1934
野的像风
野的像风 2021-01-01 23:16

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条回答
  • 2021-01-01 23:35

    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, instead only taking min(R,G,B) into account: min(R,G,B)/I.

    Sources

    • Wikipedia: HSL and HSV
    • Wikipedia: Hue
    0 讨论(0)
  • 2021-01-01 23:53

    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

    Appendix: RGB->HSV, RGB->HSL

    0 讨论(0)
提交回复
热议问题