HSL and HSV

The HSV color space is the color space of several color models, in which you define the color using the color value (english hue ), chroma ( saturation ) and the light value ( or the dark shade ) (value). Similar definitions lead to a HSL color space with the relative brightness ( lightness ), a HSB color space with the absolute magnitude ( brightness ) and an HSI color space with the light intensity ( intensity ).

  • 4.1 Conversion RGB to HSV / HSL
  • 4.2 Conversion HSV to RGB

Coordinates of the HSV color model

The following parameters are used for the description of the spectrum locus in this color space:

  • Color value as hue angle H on the color wheel ( about 0 ° for red, 120 for green °, 240 ° for blue )
  • Saturation S in percent ( 0% = neutral gray, 50 % = low in saturated color, 100 % = saturated, pure color ) or in an interval from zero to one
  • Called bright value V as a percentage (0 % = no brightness, 100% = full brightness ), or in an interval from zero to one, even dark stage.

HSV space and color perception

In matters of color matching the HSV- paradigm over the alternatives RGB and CMYK is preferred because it is similar to the human (artistic) color perception. So it is easier to find each color you want: You can directly select the color for the color mixture and then decide how saturated and how bright (or dark) this should be, or whether a different shade of color is more appropriate. RGB and CMYK, however, are choosing methods that are bound to the existing ( device-dependent ) basic colors, so there is less freedom of choice, but the color result is in the foreground.

The HSV- coordinates of a body color - which is necessarily a mixed color - are not directly be determined from the parameters of their physical light spectrum as this is possible in radiometry with the spectral value curves. By means of suitable colorimetric formula sets is inferred from the HSV coordinates on the parameters such as wavelength and amplitude. Limiting effect here, however, the metamerism, since it is not without problems is possible, of three parameters to determine the plurality of spectrum. For applications of the HSV system, however, it is usually to range of colors.

  • Hue: it specifies the dominant wavelength of the color, with the exception of the region between blue-violet and red ( 240 ° and 360 °), where it indicates a position on the purple line.
  • Saturation corresponds to the " mixing " of pure white (i.e., light having the same intensity in all wavelengths greater " admixture " corresponds to less saturated ) to form a simulated spectral, or rather of the gap width corresponding to the dominant wavelength around.
  • Brightness: parameters for the total energy content, or the maximum amplitude of the light. The dark shade complements this value in opposites.

A disadvantage of the dark state that white and any color can have the same saturation. In this system, White is treated as a stained color. In practice, once again transforming a color image into a black -and-white image by changing only one coordinate is not possible.

Visualization of the HSV model

Models of the color space

  • A method for the HSV- parameters to make clear is standing on top of HSV- cone, so that the brightness increases from bottom to top.
  • Other representations use a cylinder, the (actually only one) to the surface is black.
  • Metric more accurate models use a hemisphere.
  • If the HSV color space represented as a hexagonal pyramid, the S values ​​are not read directly, or it can be S- values ​​are used, which result in a sum of 100 % only the six basic colors. This model is a precise on the gamut problem, but is not a color space.

The variants as a double cone, double pyramid, or sphere result for the HSL, HSI and HSB models described below.

Due to the various forms of presentation, the HSV values ​​( scalar color numbers ) are different for the same color point and it must be used in addition, the model specified. Thus, the HSV models are particularly useful for direct selection or display of colors, colorimetric they are unfavorable.

In the selection and definition of devices is a device- internal, software-generated translation of HSV in Lab coordinates to other color models are then transferable.

Color Picker for the HSV space

A representation of the color space by the HSV model is common for color picker in the computer sector. To select a certain color by means of their HSV- parameter and to determine the values ​​to be used in a separate diagram of the HSV color circle from which the hue H is selected directly. Thereafter, the other two parameters S and V can be selected. This can be done in a triangle, in which the saturation S removed at a side of the triangle, and the magnitude V on the mean perpendiculars. A variant is a lying inside the color wheel SV - triangle whose tip points to the hue H in the color circle. The triangular side of the saturation S ends here in this tip. In addition, variants with a fixed vertical axis for S are common.

A program that uses such a color picker, color H to each of the matching section determined by the color body and puts it in the triangle dar. The cut is a vertically standing, radial section along the white-black axis.

Another variation of the color picker on the basis of the HSV model represents a HV level, there is a separate S-controller available in addition to the. To support the color selected by the user in the saturation of the colors shown in the HV level is adapted to the respective value of the S- regulator as soon as it is changed. This representation corresponds to a horizontal section through the color space.

Transformation of RGB and HSV / HSL

The conversion follows the formula set by Gonzalez and Woods.

  • (R, G, B ) color values ​​to RGB. R, G, and B are to the interval [ 0,1].
  • (H, S, V ): related HSV color. H is in the semi-open interval [ 0 °, 360 °) to ensure uniqueness, S and V, in turn, in the interval [ 0.100 % ] or [ 0,1].

These intervals are for the model presented here. Other sets of formulas with same result give Foley and Van Dam or Travis.

  • Are also common colorimetric data of H, S and V normalized to [ 0.1 ] are similar to those by the RGB model. The formula given below sentence would then be correspondingly simpler.
  • Furthermore, values ​​at an interval [ 0,255 ], hexadecimal as [ 0 FF] in use, are suitable for 8-bit data ( discrete model ). For the formulas given such values ​​are normalized to the intervals used here. Also note whether the body for the underlying model is a cube, a sphere, a cone or double cone.

Conversion RGB to HSV / HSL

These formulas reflect some peculiarities of the HSV values ​​resist:

  • If R = G = B, then H has no meaning, and is set by definition H = 0. That is obvious. For if S = 0 ( unsaturated color), then the locus lies on the central gray line, the color is of no importance and can not usefully be specified.
  • If R = G = B = 0, then S is of no importance, and by definition is S = 0. For all three RGB values ​​" zero ", it goes to black, and the saturation of the color loses its meaning. The same is true in the case of MAX = MIN = 1, ie White, here provides the formula formal 0

Undefined values ​​are taken from computational reasons, with "zero".

Conversion HSV to RGB

There the basic colors interval hi, the value within this interval f in [0,1] and three auxiliary values ​​are determined, which already contain the respective path lengths, but must be distributed according to the components R, G and B:

If S = 0, then the resulting color is neutral gray, and the formula simplifies to R = G = B = V.

Modified color models HSL, HSB, HSI

The HSL color space (also known as HLS) has the parameters hue H, saturation S and color brightness L. In contrast to the HSV color space however, it is based on the lying between white and black gray point as neutral gray. The body color is represented as a double cone, cylinder or six -sided prism. The chromatic values ​​are on the outside of the gray dot in the middle. Similarly constructed the CIE Lch ° model with color lightness L, chroma C and hue angle h is the degrees, which corresponds to a certain extent he represented in cylindrical coordinates Lab color space.

Oriented towards the needs of colorimetry and the photo- mechanical reproduction is the HSB and the HSI model. Again, H stands for chromatic value (hue ) and S for saturation. The difference relates to the third coordinate: on the one hand HSB with the size of the radiation brightness, the absolute brightness B, on the other hand, as the HSI color model with the light intensity I.

Partial assignments of the other hue angle to the color circle are common, which then differ on the chromatic value scale in the position of the zero point. Conversions for these modified HSV- spaces can be found in Gonzalez and Woods or Foley and Van Dam.

326553
de