HSV color space
- Color value ( English h ue ): color angle on the color wheel (0 ° for red, 120 ° for green, 240 ° for blue)
- Saturation ( s aturation) : (0% = neutral gray , 50% = low in saturated color, 100% = saturated, pure color ), corresponding to an interval from zero to one
- Brightness value (also called dark level) ( v alue) : (0% = no brightness, 100% = full brightness), corresponds to an interval from zero to one
Similar definitions lead to
- an HSL color space having the relative brightness ( l ightness) instead of the bright value
- an HSB color space with absolute brightness ( b rightness)
- an HSI color space with the light intensity ( i ntensity) .
HSV room and color perception
In matters of color matching the HSV paradigm over the alternatives RGB and CMYK preferred because it is the human (artistic) perception of color is similar. For the color mixture , you can immediately choose the desired shade and then decide how saturated and how light (or dark) it should be, or whether another shade is more suitable:
- the hue angle specifies the dominant wavelength of the color, with the exception of the area between blue-violet and red (240 ° and 360 °), where it indicates a position on the purple line .
- the saturation corresponds to the admixture of pure white (i.e. light with equal intensities in all wavelengths) to a simulated spectral color (or rather the corresponding slit width around the dominant wavelength); a stronger addition of white corresponds to a lower saturation.
- the brightness is a parameter for the total energy content or for the maximum amplitude of the light; the level of darkness complements this value on the contrary. The disadvantage of the dark level is that white and any hue can have the same saturation. In this system, white is treated as a chromatic color. In practice, on the other hand, it is not possible to convert a color image into a black and white image by changing just one coordinate.
RGB and CMYK, on the other hand, are selection methods that are tied to the existing (device-dependent) basic colors , so that the focus is less on the free choice than on the color result.
The HSV coordinates of a body color - which is necessarily a mixed color - cannot be determined directly from the parameters of its physical light spectrum , as is possible in radiometry with the spectral value curves . In contrast, the HSV coordinates are used to infer the parameters of the spectrum such as wavelength and amplitude using suitable colorimetric formula sets . However, metamerism has a limiting effect here , since it is not possible without problems to determine the multiplicity of a spectrum from three coordinates; However, this is not a major problem, since the HSV system is usually not used to determine the properties of a spectrum, but to select colors.
Color models that clearly illustrate the HSV parameters are:
- the HSV cone standing on the tip , in which the brightness decreases from the top (color circle) to the bottom (tip = black).
- a cylinder in which the brightness decreases to an area (instead of a point).
- a hemisphere , the colorimetrically correct model.
- a hexagonal pyramid (illustration e.g. here ), which deals more precisely with the gamut problem. However, the S values can no longer be read directly, or they only give a total of 100% for the six basic colors . The hexagonal pyramid is not a color space.
Due to the wide variety of forms of representation, the HSV values for the same color point differ in some cases, which means that it is essential to specify the model used. While this makes the HSV models useful for selecting and displaying colors, complications can arise when it comes to colorimetry .
By specifying the model used, HSV values can be converted into Lab coordinates , which can then be transferred to other color models.
For color selectors in computer science, it is common to use the HSV model to represent the color space. In order to select a certain color with the help of its HSV parameters and to determine the values, the HSV color wheel is used in a separate diagram , from which the hue H is selected directly. Then the other two parameters S and V are selected. This can be done on a triangle in which the saturation is plotted on one side of the triangle and the brightness is plotted on its center perpendicular . One variant is an SV triangle inside the color wheel, the tip of which points to the hue in the color wheel, the side of the triangle of saturation ends in this tip. Variants with a fixed vertical axis for S are also common. A program that uses such a color picker determines the appropriate section through the color body for color H and displays it in a triangle. The section is a vertical, radial section along the white-black axis.
Another variant of the color selector based on the HSV model is a HV level, in addition to which a separate S control is available. In order to support the color selection by the user, the saturation of the color tones displayed in the HV level is adapted to the respective value of the S controller as soon as it is changed. This representation corresponds to a conical or cylindrical section through the color space, the respective saturation corresponding to the radius of the section relative to the white-black axis.
Transformation of HSV / HSL and RGB
|colour||H||S.||V||| H||S.||L.||| R.||G||B.|
|red||0 °||100%||100%||0 °||100%||50%||100%||0%||0%|
|orange||30 °||100%||100%||30 °||100%||50%||100%||50%||0%|
|yellow||60 °||100%||100%||60 °||100%||50%||100%||100%||0%|
|Dark green||120 °||100%||50%||120 °||100%||25%||0%||50%||0%|
|violet||270 °||100%||100%||270 °||100%||50%||50%||0%||100%|
|blue||240 °||100%||100%||240 °||100%||50%||0%||0%||100%|
|brown||20 °||75%||36%||20 °||60%||22.5%||36%||18%||9%|
|green||120 °||100%||100%||120 °||100%||50%||0%||100%||0%|
|Cyan||180 °||100%||100%||180 °||100%||50%||0%||100%||100%|
|magenta||300 °||100%||100%||300 °||100%||50%||100%||0%||100%|
|Blue green||150 °||100%||100%||150 °||100%||50%||0%||100%||50%|
|Green Blue||210 °||100%||100%||210 °||100%||50%||0%||50%||100%|
|Green yellow||90 °||100%||100%||90 °||100%||50%||50%||100%||0%|
|Blue red||330 °||100%||100%||330 °||100%||50%||100%||0%||50%|
|cinnabar||15 °||100%||100%||15 °||100%||50%||100%||25%||0%|
|indigo||255 °||100%||100%||255 °||100%||50%||25%||0%||100%|
|Light blue-green||135 °||100%||100%||135 °||100%||50%||0%||100%||25%|
|Blue cyan||195 °||100%||100%||195 °||100%||50%||0%||75%||100%|
|Light green yellow||75 °||100%||100%||75 °||100%||50%||75%||100%||0%|
|Red magenta||315 °||100%||100%||315 °||100%||50%||100%||0%||75%|
|saffron||45 °||100%||100%||45 °||100%||50%||100%||75%||0%|
|Blue magenta||285 °||100%||100%||285 °||100%||50%||75%||0%||100%|
|Green cyan||165 °||100%||100%||165 °||100%||50%||0%||100%||75%|
|Light green-blue||225 °||100%||100%||225 °||100%||50%||0%||25%||100%|
|Lime||105 °||100%||100%||105 °||100%||50%||25%||100%||0%|
|Light blue red||345 °||100%||100%||345 °||100%||50%||100%||0%||25%|
The conversion follows the Gonzalez and Woods formula.
- ( R , G , B ): Color values according to RGB. R , G and B are in the interval .
- ( H , S , V ): Associated HSV color. H lies in the half-open interval to ensure uniqueness, S and V again in the interval or .
These intervals apply to the model presented here. Other formula sets with the same result give Foley and Van Dam or Travis.
- Colorimetric specifications of H , S and V are also normalized , which are therefore similar to those of the RGB model. The formula set below would then be correspondingly simpler.
- Furthermore, values in intervals are used ( hexadecimal as , octal as ) that are suitable for 8-bit information (discrete model). For the specified formulas, such values are to be normalized to the intervals used here. In addition, it should be noted whether the body for the underlying model is a cube, a sphere, a cone or a double cone.
Conversion from RGB to HSV / HSL
These formulas reflect some peculiarities of the HSV values:
- If R = G = B , then H has no meaning and is set by definition to H = 0.
- It is obvious. Because if S = 0 (unsaturated color), then the color point is on the central gray line, the hue is so irrelevant and cannot be specified meaningfully.
- If R = G = B = 0, then S is irrelevant and, by definition, S = 0 is set.
- Because if all three RGB values are "zero", it is about black and the saturation of the color loses its meaning. However, the same does not apply in the case of MAX = MIN = 1, i.e. H. Knows that the value 0 delivered by the formula is of elementary importance, as can be seen from the cone shape above.
For computational reasons, undefined values are filled with "zero".
Conversion from HSV to RGB
The basic color interval, the value within this interval in and three additional values are determined which already contain the respective route lengths, but are to be distributed accordingly to the components R , G and B :
If S = 0, the resulting color neutral gray, and the formula is simplified to R = G = B = V .
Modified color models
Sometimes other assignments of the color angle to the color wheel are common, which then differ in the position of the zero point on the chrominance scale. Conversions for these modified HSV rooms can be found at Gonzalez and Woods or Foley and Van Dam.
The HSL color space (also referred to as HLS) has the parameters color angle H, color saturation S and color lightness L. In contrast to the HSV color space, however, it is related to the gray point between white and black as neutral gray . The gray point is in the middle and the chromatic values on the outside, the color body is therefore represented as a double cone , (double) cylinder or six-sided prism .
The CIE-LCh ° model has a similar structure with color brightness L, chroma C (corresponds to the saturation) and the hue angle h ° (corresponds to the hue angle), which corresponds to a Lab color space in cylindrical coordinates.
HSB and HSI
- Rafael Gonzalez, Richard E. Woods: Digital Image Processing . Prentice Hall Press, 2002, ISBN 0-201-18075-8 , pp. 295 .
- according to HSV color space - English Wikipedia, the set of formulas is given here somewhat differently
- Adrian Ford, Alan Roberts: Color Space Conversions. In: The Color (color) Equations Document. September 1996, accessed August 30, 2006 .
- James D. Foley, Andries van Dam, Steven K. Feiner, John F. Hughes: Computer Graphics: Principles and Practice in C . Addison-Wesley, Munich 1990.
- Adrian Ford, Alan Roberts: HSV: Hue Saturation Value. In: The Color (color) Equations Document. September 1996, accessed August 30, 2006 .
- D. Travis: Effective Color Displays . Theory and Practice. Academic Press, 1991, ISBN 0-12-697690-2 .
- Adrian Ford, Alan Roberts: HSI: Hue Saturation Intensity. In: The Color (color) Equations Document. September 1996, accessed August 30, 2006 .
- Adrian Ford, Alan Roberts: HSL: Hue Saturation Lightness. In: The Color (color) Equations Document. September 1996, accessed August 30, 2006 .