11

янв

Jun 22, 2013  Model warna HSV mendefinisikan warna dalam terminology Hue, Saturation dan Value. Definisi untuk Hue dan Saturation sama dengan definisi pada model HSL, sedangkan untuk value memiliki arti kecerahan dari warna yang ada variasi dengan warna saturation. Nilainya berkisar antara 0. Segmentasi warna merupakan salah satu metode segmentasi citra yang memisahkan antara objek dengan background berdasarkan ciri warna tertentu dari objek tersebut. Proses segmentasi warna, salah satunya dapat dilakukan dengan cara mengkonversi ruang warna citra yang semula RGB (Red, Green, Blue) menjadi ruang warna HSV (Hue, Saturation, Value).

Alternative representations of the RGB color modelHSL ( hue, saturation, lightness) and HSV ( hue, saturation, value) are alternative representations of the, designed in the 1970s by researchers to more closely align with the way human vision perceives color-making attributes. In these models, colors of each are arranged in a radial slice, around a central axis of neutral colors which ranges from black at the bottom to white at the top.

The HSV representation models the way paints of different colors mix together, with the saturation dimension resembling various tints of brightly colored paint, and the value dimension resembling the mixture of those paints with varying amounts of black or white paint. The HSL model attempts to resemble more perceptual color models such as the (NCS) or, placing fully saturated colors around a circle at a lightness value of ​ 1⁄ 2, where a lightness value of 0 or 1 is fully black or white, respectively. HSV cylinder.HSL and HSV are both cylindrical geometries ( fig. 2), with hue, their angular dimension, starting at the at 0°, passing through the primary at 120° and the primary at 240°, and then wrapping back to red at 360°. In each geometry, the central vertical axis comprises the neutral, achromatic, or gray colors, ranging from black at lightness 0 or value 0, the bottom, to white at lightness 1 or value 1, the top.In both geometries, the primary and —red, green, blue and —and linear mixtures between adjacent pairs of them, sometimes called pure colors, are arranged around the outside edge of the cylinder with saturation 1. These saturated colors have lightness 0.5 in HSL, while in HSV they have value 1.

Mixing these pure colors with black—producing so-called —leaves saturation unchanged. In HSL, saturation is also unchanged by with white, and only mixtures with both black and white—called tones—have saturation less than 1. In HSV, tinting alone reduces saturation. If we plot hue and (a) HSL lightness or (b) HSV value against chroma ( of RGB values) rather than saturation (chroma over maximum chroma for that slice), the resulting solid is a or, respectively, not a cylinder.

Such diagrams often claim to represent HSL or HSV directly, with the chroma dimension confusingly labelled 'saturation'.Because these definitions of saturation—in which very dark (in both models) or very light (in HSL) near-neutral colors are considered fully saturated (for instance, from the bottom right in the sliced HSL cylinder or from the top right)—conflict with the intuitive notion of color purity, often a or solid is drawn instead ( fig. 3), with what this article calls chroma as its radial dimension (equal to the of the RGB values), instead of saturation (where the saturation is equal to the chroma over the maximum chroma in that slice of the (bi)cone).

Confusingly, such diagrams usually label this radial dimension 'saturation', blurring or erasing the distinction between saturation and chroma., computing chroma is a helpful step in the derivation of each model. Because such an intermediate model—with dimensions hue, chroma, and HSV value or HSL lightness—takes the shape of a cone or bicone, HSV is often called the 'hexcone model' while HSL is often called the 'bi-hexcone model'. See also:, andMost televisions, computer displays, and projectors produce colors by combining red, green, and blue light in varying intensities—the so-called.

The resulting mixtures in can reproduce a wide variety of colors (called a ); however, the relationship between the constituent amounts of red, green, and blue light and the resulting color is unintuitive, especially for inexperienced users, and for users familiar with mixing of paints or traditional artists' models based on tints and shades ( fig. Furthermore, neither additive nor subtractive color models define color relationships the same way the does.For example, imagine we have an RGB display whose color is controlled by three ranging from 0–255, one controlling the intensity of each of the red, green, and blue primaries. If we begin with a relatively colorful, with values R = 217, G = 118, B = 33, and want to reduce its colorfulness by half to a less saturated orange, we would need to drag the sliders to decrease R by 31, increase G by 24, and increase B by 59, as pictured below.In an attempt to accommodate more traditional and intuitive color mixing models, computer graphics pioneers at and introduced the HSV model for computer display technology in the mid-1970s, formally described by in the August 1978 issue of. In the same issue, Joblove and Greenberg described the HSL model—whose dimensions they labeled hue, relative chroma, and intensity—and compared it to HSV ( fig. Their model was based more upon how colors are organized and conceptualized in in terms of other color-making attributes, such as hue, lightness, and chroma; as well as upon traditional color mixing methods—e.g., in painting—that involve mixing brightly colored pigments with black or white to achieve lighter, darker, or less colorful colors.The following year, 1979, at, introduced graphics terminals using HSL for color designation, and the Computer Graphics Standards Committee recommended it in their annual status report ( fig.

These models were useful not only because they were more intuitive than raw RGB values, but also because the conversions to and from RGB were extremely fast to compute: they could run in real time on the hardware of the 1970s. Consequently, these models and similar ones have become ubiquitous throughout image editing and graphics software since then.

Some of their uses are described. See also:The dimensions of the HSL and HSV geometries—simple transformations of the not-perceptually-based RGB model—are not directly related to the color-making attributes of the same names, as defined by scientists such as the. Nonetheless, it is worth reviewing those definitions before leaping into the derivation of our models. For the definitions of color-making attributes which follow, see: The 'attribute of a visual sensation according to which an area appears to be similar to one of the: red, yellow, green, and blue, or to a combination of two of them'. ( L e,Ω) The of light passing through a particular surface per unit per unit projected area, measured in in per per ( Wsr −1m −2).

( Y or L v,Ω) The radiance weighted by the effect of each wavelength on a typical human observer, measured in SI units in ( cd/m 2). Often the term luminance is used for the, Y/ Y n, where Y n is the luminance of the reference. ( Y′) The weighted sum of R′, G′, and B′ values, and used in, for compression and video transmission. The 'attribute of a visual sensation according to which an area appears to emit more or less light'., value The 'brightness relative to the brightness of a similarly illuminated white'. The 'attribute of a visual sensation according to which the perceived color of an area appears to be more or less chromatic'.

The 'colorfulness relative to the brightness of a similarly illuminated white'. The 'colorfulness of a stimulus relative to its own brightness'.Brightness and colorfulness are absolute measures, which usually describe the of light entering the eye, while lightness and chroma are measured relative to some white point, and are thus often used for descriptions of surface colors, remaining roughly constant even as brightness and colorfulness change with different.

Saturation can be defined as either the ratio of colorfulness to brightness or that of chroma to lightness.General approach HSL, HSV, and related models can be derived via geometric strategies, or can be thought of as specific instances of a 'generalized LHS model'. The HSL and HSV model-builders took an RGB cube—with constituent amounts of red, green, and blue light in a color denoted R, G, B —and tilted it on its corner, so that black rested at the origin with white directly above it along the vertical axis, then measured the hue of the colors in the cube by their angle around that axis, starting with red at 0°. Then they came up with a characterization of brightness/value/lightness, and defined saturation to range from 0 along the axis to 1 at the most colorful point for each pair of other parameters. Hue and chroma. By the 1990s, HSL and HSV color selection tools were ubiquitous. The screenshots above are taken from: (a) SGI 5, c. 1995; (b), c.

1990; (c) IBM 3, c. 1994; (d) Apple Macintosh, c.

1996; (e) Fractal Design, c. 1993; (f) Microsoft, c. 1992; (g), c. 1995.These are undoubtedly based on earlier examples, stretching back to PARC and NYIT in the mid-1970s.The original purpose of HSL and HSV and similar models, and their most common current application, is in. At their simplest, some such color pickers provide three sliders, one for each attribute. Most, however, show a two-dimensional slice through the model, along with a slider controlling which particular slice is shown.

The latter type of GUI exhibits great variety, because of the choice of cylinders, hexagonal prisms, or cones/bicones that the models suggest (see the diagram near the ). Several color choosers from the 1990s are shown to the right, most of which have remained nearly unchanged in the intervening time: today, nearly every computer color chooser uses HSL or HSV, at least as an option. Some more sophisticated variants are designed for choosing whole sets of colors, basing their suggestions of compatible colors on the HSL or HSV relationships between them.Most web applications needing color selection also base their tools on HSL or HSV, and pre-packaged open source color choosers exist for most major web front-end. The specification allows web authors to specify colors for their pages directly with HSL coordinates.HSL and HSV are sometimes used to define gradients for, as in maps or medical images. For example, the popular program historically applied customizable HSV-based gradients to numerical geographical data. The hue/saturation tool in 2.5, ca.

1992.software also commonly includes tools for adjusting colors with reference to HSL or HSV coordinates, or to coordinates in a model based on the 'intensity' or luma. In particular, tools with a pair of 'hue' and 'saturation' sliders are commonplace, dating to at least the late-1980s, but various more complicated color tools have also been implemented. For instance, the image viewer and color editor allowed six user-definable hue ( H) ranges to be rotated and resized, included a -like control for saturation ( S HSV), and a -like interface for controlling value ( V)—see fig. The image editor includes a 'color correction' tool which affords complex remapping of points in a hue/saturation plane relative to either HSL or HSV space.also use these models. For example, both and include color tools based on HSL or a similar geometry for use adjusting the color in video. With the Avid tool, users pick a vector by clicking a point within the hue/saturation circle to shift all the colors at some lightness level (shadows, mid-tones, highlights) by that vector.Since version 4.0, Adobe Photoshop's 'Luminosity', 'Hue', 'Saturation', and 'Color' composite layers using a luma/chroma/hue color geometry.

These have been copied widely, but several imitators use the HSL (e.g., ) or HSV (e.g. ) geometries instead. See also: andHSL, HSV, HSI, or related models are often used in and for. The applications of such tools include object detection, for instance in;, for instance of, or;; and.For the most part, computer vision algorithms used on color images are straightforward extensions to algorithms designed for images, for instance or of pixel colors,. At the simplest, each color component is separately passed through the same algorithm. It is important, therefore, that the of interest can be distinguished in the color dimensions used.

Because the R, G, and B components of an object's color in a digital image are all correlated with the amount of light hitting the object, and therefore with each other, image descriptions in terms of those components make object discrimination difficult. Descriptions in terms of hue/lightness/chroma or hue/lightness/saturation are often more relevant.Starting in the late 1970s, transformations like HSV or HSI were used as a compromise between effectiveness for segmentation and computational complexity. They can be thought of as similar in approach and intent to the neural processing used by human color vision, without agreeing in particulars: if the goal is object detection, roughly separating hue, lightness, and chroma or saturation is effective, but there is no particular reason to strictly mimic human color response.

John Kender's 1976 master's thesis proposed the HSI model. (1980) instead used a model made up of dimensions similar to those we have called I, α, and β. In recent years, such models have continued to see wide use, as their performance compares favorably with more complex models, and their computational simplicity remains compelling. Disadvantages. The gamut mapped in CIELAB space.

Also notice that these two RGB spaces have different gamuts, and thus will have different HSL and HSV representations.While HSL, HSV, and related spaces serve well enough to, for instance, choose a single color, they ignore much of the complexity of color appearance. Essentially, they trade off perceptual relevance for computation speed, from a time in computing history (high-end 1970s graphics workstations, or mid-1990s consumer desktops) when more sophisticated models would have been too computationally expensive.HSL and HSV are simple transformations of RGB which preserve symmetries in the RGB cube unrelated to human perception, such that its R, G, and B corners are equidistant from the neutral axis, and equally spaced around it.

If we plot the RGB gamut in a more perceptually-uniform space, such as (see ), it becomes immediately clear that the red, green, and blue primaries do not have the same lightness or chroma, or evenly spaced hues. Furthermore, different RGB displays use different primaries, and so have different gamuts.

Because HSL and HSV are defined purely with reference to some RGB space, they are not: to specify a color precisely requires reporting not only HSL or HSV values, but also the characteristics of the RGB space they are based on, including the in use.If we take an image and extract the hue, saturation, and lightness or value components, and then compare these to the components of the same name as defined by color scientists, we can quickly see the difference, perceptually. For example, examine the following images of a fire breather ( fig. The original is in the sRGB colorspace.

CIELAB L. is a CIE-defined achromatic lightness quantity (dependent solely on the perceptually achromatic luminance Y, but not the mixed-chromatic components X or Z, of the CIEXYZ colorspace from which the sRGB colorspace itself is derived), and it is plain that this appears similar in perceptual lightness to the original color image.

Luma is roughly similar, but differs somewhat at high chroma, where it deviates most from depending solely on the true achromatic luminance ( Y, or equivalently L.) and is influenced by the colorimetric chromaticity ( x,y, or equivalently, a.,b. of CIELAB). HSL L and HSV V, by contrast, diverge substantially from perceptual lightness. HSL lightness L.Though none of the dimensions in these spaces match their perceptual analogs, the value of HSV and the saturation of HSL are particular offenders. In HSV, the blue primary and white are held to have the same value, even though perceptually the blue primary has somewhere around 10% of the luminance of white (the exact fraction depends on the particular RGB primaries in use). In HSL, a mix of 100% red, 100% green, 90% blue—that is, a very light yellow —is held to have the same saturation as the green primary, even though the former color has almost no chroma or saturation by the conventional psychometric definitions.

Such perversities led Cynthia Brewer, expert in color scheme choices for maps and information displays, to tell the:Computer science offers a few poorer cousins to these perceptual spaces that may also turn up in your software interface, such as HSV and HLS. They are easy mathematical transformations of RGB, and they seem to be perceptual systems because they make use of the hue–lightness/value–saturation terminology.

But take a close look; don't be fooled. Perceptual color dimensions are poorly scaled by the color specifications that are provided in these and some other systems. For example, saturation and lightness are confounded, so a saturation scale may also contain a wide range of lightnesses (for example, it may progress from white to green which is a combination of both lightness and saturation). Likewise, hue and lightness are confounded so, for example, a saturated yellow and saturated blue may be designated as the same 'lightness' but have wide differences in perceived lightness. These flaws make the systems difficult to use to control the look of a color scheme in a systematic manner.

If much tweaking is required to achieve the desired effect, the system offers little benefit over grappling with raw specifications in RGB or CMY.If these problems make HSL and HSV problematic for choosing colors or color schemes, they make them much worse for image adjustment. HSL and HSV, as Brewer mentioned, confound perceptual color-making attributes, so that changing any dimension results in non-uniform changes to all three perceptual dimensions, and distorts all of the color relationships in the image. For instance, rotating the hue of a pure dark blue toward green will also reduce its perceived chroma, and increase its perceived lightness (the latter is grayer and lighter), but the same hue rotation will have the opposite impact on lightness and chroma of a lighter bluish-green— to (the latter is more colorful and slightly darker).

In the example below ( fig. 21), the image on the left (a) is the original photograph of a. In the middle image (b), we have rotated the hue ( H) of each color by −30°, while keeping HSV value and saturation or HSL lightness and saturation constant.

In the image on the right (c), we make the same rotation to the HSL/HSV hue of each color, but then we force the CIELAB lightness ( L., a decent approximation of perceived lightness) to remain constant. Notice how the hue-shifted middle version without such a correction dramatically changes the perceived lightness relationships between colors in the image. In particular, the turtle's shell is much darker and has less contrast, and the background water is much lighter.

Hue shifted but CIELAB lightness ( L.) kept as in the original.Because hue is a circular quantity, represented numerically with a discontinuity at 360°, it is difficult to use in statistical computations or quantitative comparisons: analysis requires the use of. Furthermore, hue is defined piecewise, in 60° chunks, where the relationship of lightness, value, and chroma to R, G, and B depends on the hue chunk in question. This definition introduces discontinuities, corners which can plainly be seen in horizontal slices of HSL or HSV.Charles Poynton, digital video expert, lists the above problems with HSL and HSV in his Color FAQ, and concludes that:HSB and HLS were developed to specify numerical Hue, Saturation and Brightness (or Hue, Lightness and Saturation) in an age when users had to specify colors numerically.

Code:PCSX2 1.4.0-0- compiled on Jan 6 2016Savestate version: 0x9a0b0000Host Machine Init:Operating System = Linux 4.4.0-59-lowlatency x8664Physical RAM = 7779 MBCPU name = Intel(R) Core(TM) i3 CPU M 330 @ 2.13GHzVendor/Model = GenuineIntel (stepping 02)CPU speed = 2.125 ghz (4 logical threads)x86PType = Standard OEMx86Flags = bfebfbff 0098e3bdx86EFlags = 28100000x86 Features Detected:SSE2. Pcsx2 plugins pack

The usual formulations of HSB and HLS are flawed with respect to the properties of color vision. Now that users can choose colors visually, or choose colors related to other media (such as ), or use perceptually-based systems like and, HSB and HLS should be abandoned. Other cylindrical-coordinate color models. The paper first introducing HSL, they called HSL lightness 'intensity', called HSL saturation 'relative chroma', called HSV saturation 'saturation' and called HSV value 'value'. They carefully and unambiguously described and compared three models: hue/chroma/intensity, hue/relative chroma/intensity, and hue/value/saturation. Unfortunately, later authors were less fastidious, and current usage of these terms is inconsistent and often misleading. The name hexcone for hexagonal pyramid was coined in, and stuck.

For instance, a 1982 study by Berk, et al., found that users were better at describing colors in terms of HSL than RGB coordinates, after being taught both systems, but were much better still at describing them in terms of the natural-language CNS model (which uses names such as 'very dark grayish yellow-green' or 'medium strong bluish purple'). This shouldn't be taken as gospel however: a 1987 study by Schwarz, et al., found that users could match colors using RGB controls faster than with HSL controls; a 1999 study by Douglas and Kirkpatrick found that the visual feedback in the user interface mattered more than the particular color model in use, for user matching speed.

'Clearly, if color appearance is to be described in a systematic, mathematical way, definitions of the phenomena being described need to be precise and universally agreed upon.' . In formulation, R, G, and B stand for the voltages on the guns of a CRT display, which might have different maxima, and so their cartesian could be a box of any unequal dimensions. Other definitions commonly use integer values in the range 0, 255, storing the value for each component in one. We define the RGB gamut to be a for convenience because it simplifies and clarifies the math. Also, in general, HSL and HSV are today computed directly from R′, G′, and B′—for instance in space—but, when the models were developed, might have been transformations of a linear RGB space. Early authors don’t address gamma correction at all, except who clearly states that 'We shall assume that an RGB monitor is a linear device', and thus designed HSV using linear RGB.

We will drop the primes, and the labels R, G, and B should be taken to stand for the three attributes of the origin RGB space, whether or not it is gamma corrected. Using the chroma here not only agrees with the original paper, but is also in the proper spirit of the psychometric definition of the term. Some models call this attribute saturation—for instance 's 'Saturation' blend mode—but such use is even more confusing than the use of the term in HSL or HSV, especially when two substantially different definitions are used side by side. ^ Most of the computer graphics papers and books discussing HSL or HSV have a formula or algorithm describing them formally. Our formulas which follow are some mix of those.

See, for instance, or. put a great deal of effort into explaining why what we call chroma here can be written as max( R, G, B) − min( R, G, B), and showing that this value is a. They reserve the name chroma for the in the chromaticity plane (our C 2), and call this hexagonal distance saturation instead, as part of their IHLS model. In the following, the multiplication of hue by 60°—that is, 360°/6—can be seen as the hexagonal-geometry analogue of the conversion from to degrees, a multiplication by 360°/2 π: the circumference of a is 2 π; the circumference of a unit hexagon is 6. For a more specific discussion of the term luma, see Charles.

Photoshop exclusively uses the NTSC coefficients for its 'Luminosity' blend mode regardless of the RGB color space involved. The first nine colors in this table were chosen by hand, and the last ten colors were chosen at random. See. Many of these screenshots were taken from the, and the rest were gathered from image search results.

For instance, a tool in CS4, and Adobe's related web tool, both allow users to define color schemes based on HSV relationships, but with a hue circle modified to better match the used traditionally by painters. The web tools, and all pick color schemes with reference to HSL or HSV. Try a web search for 'framework name' color picker' for examples for a given framework, or ' color picker' for general results. ArcGIS calls its map-symbol gradients 'color ramps'.

Current versions of ArcGIS can use CIELAB instead for defining them. For instance, the first version of Photoshop had an HSL-based tool; see in the GUIdebook for screenshots. Photoshop's documentation explains that, e.g., 'Luminosity: Creates a result color with the hue and saturation of the base color and the luminance of the blend color.' . The Ohta et al. Model has parameters I 1 = ( R + G + B)/3, I 2 = ( R − B)/2, I 3 = (2 G − R − B)/4. I 1 is the same as our I, and I 2 and I 3 are similar to our β and α, respectively, except that (a) where α points in the direction of R in the 'chromaticity plane', I 3 points in the direction of G, and (b) the parameters have a different linear scaling which avoids the √ 3 of our β.

Most of the disadvantages below are listed in, though as mere statements, without examples. Some points in this cylinder fall out of.References.

HSL (hue, saturation, lightness) and HSV (hue, saturation, value) are alternative representations of the RGB color model, designed in the 1970s by computer graphics researchers to more closely align with the way human vision perceives color-making attributes. In these models, colors of each hue are arranged in a radial slice, around a central axis of neutral colors which ranges from black at the bottom to white at the top. The HSV representation models the way paints of different colors mix together, with the saturation dimension resembling various tints of brightly colored paint, and the value dimension resembling the mixture of those paints with varying amounts of black or white paint. The HSL model attempts to resemble more perceptual color models such as the Natural Color System (NCS) or Munsell color system, placing fully saturated colors around a circle at a lightness value of ​12, where a lightness value of 0 or 1 is fully black or white, respectively.

  • 3Formal derivation
  • 8Color conversion formulae
    • 8.1To RGB
    • 8.2Interconversion
  • 9Swatches

Basic principle[edit]

Fig. 2a. HSL cylinder.
Fig. 2b. HSV cylinder.

HSL and HSV are both cylindrical geometries (fig. 2), with hue, their angular dimension, starting at the redprimary at 0°, passing through the green primary at 120° and the blue primary at 240°, and then wrapping back to red at 360°. In each geometry, the central vertical axis comprises the neutral, achromatic, or gray colors, ranging from black at lightness 0 or value 0, the bottom, to white at lightness 1 or value 1, the top.

In both geometries, the additive primary and secondary colors—red, yellow, green, cyan, blue and magenta—and linear mixtures between adjacent pairs of them, sometimes called pure colors, are arranged around the outside edge of the cylinder with saturation 1. These saturated colors have lightness 0.5 in HSL, while in HSV they have value 1. Mixing these pure colors with black—producing so-called shades—leaves saturation unchanged. In HSL, saturation is also unchanged by tinting with white, and only mixtures with both black and white—called tones—have saturation less than 1. In HSV, tinting alone reduces saturation.

Fig. 3a–b. If we plot hue and (a) HSL lightness or (b) HSV value against chroma (range of RGB values) rather than saturation (chroma over maximum chroma for that slice), the resulting solid is a bicone or cone, respectively, not a cylinder. Such diagrams often claim to represent HSL or HSV directly, with the chroma dimension confusingly labelled 'saturation'.

Because these definitions of saturation—in which very dark (in both models) or very light (in HSL) near-neutral colors are considered fully saturated (for instance, from the bottom right in the sliced HSL cylinder or from the top right)—conflict with the intuitive notion of color purity, often a conic or biconic solid is drawn instead (fig. 3), with what this article calls chroma as its radial dimension (equal to the range of the RGB values), instead of saturation (where the saturation is equal to the chroma over the maximum chroma in that slice of the (bi)cone). Confusingly, such diagrams usually label this radial dimension 'saturation', blurring or erasing the distinction between saturation and chroma.[A]As described below, computing chroma is a helpful step in the derivation of each model. Because such an intermediate model—with dimensions hue, chroma, and HSV value or HSL lightness—takes the shape of a cone or bicone, HSV is often called the 'hexcone model' while HSL is often called the 'bi-hexcone model' (fig. 8).[B]

Motivation[edit]

The HSL color space was invented for television in 1938 by Georges Valensi as a method to add color encoding to existing monochrome (i.e. only containing the L signal) broadcasts, allowing existing receivers to receive new color broadcasts (in black and white) without modification as the luminance (black and white) signal is broadcast unmodified. It has been used in all major analog broadcast television encoding including NTSC, PAL and SECAM and all major digital broadcast systems and is the basis for composite video.[1][2]

Fig. 4. Painters long mixed colors by combining relatively bright pigments with black and white. Mixtures with white are called tints, mixtures with black are called shades, and mixtures with both are called tones. See Tints and shades.[3]
Fig. 5. This 1916 color model by German chemist Wilhelm Ostwald exemplifies the 'mixtures with white and black' approach, organizing 24 'pure' colors into a hue circle, and colors of each hue into a triangle. The model thus takes the shape of a bicone.[4][5]
Fig. 6a. The RGB gamut can be arranged in a cube.
Fig. 6b. The same image, with a portion removed for clarity.
Fig. 7. Tektronix graphics terminals used the earliest commercial implementation of HSL, in 1979. This diagram, from a patent filed in 1983, shows the bicone geometry underlying the model.[6]

Most televisions, computer displays, and projectors produce colors by combining red, green, and blue light in varying intensities—the so-called RGBadditiveprimary colors. The resulting mixtures in RGB color space can reproduce a wide variety of colors (called a gamut); however, the relationship between the constituent amounts of red, green, and blue light and the resulting color is unintuitive, especially for inexperienced users, and for users familiar with subtractive color mixing of paints or traditional artists' models based on tints and shades (fig. 4). Furthermore, neither additive nor subtractive color models define color relationships the same way the human eye does.[C]

For example, imagine we have an RGB display whose color is controlled by three sliders ranging from 0–255, one controlling the intensity of each of the red, green, and blue primaries. If we begin with a relatively colorful orange, with sRGB values R = 217, G = 118, B = 33, and want to reduce its colorfulness by half to a less saturated orange , we would need to drag the sliders to decrease R by 31, increase G by 24, and increase B by 59, as pictured below.

In an attempt to accommodate more traditional and intuitive color mixing models, computer graphics pioneers at PARC and NYIT introduced the HSV model for computer display technology in the mid-1970s, formally described by Alvy Ray Smith[10] in the August 1978 issue of Computer Graphics. In the same issue, Joblove and Greenberg[11] described the HSL model—whose dimensions they labeled hue, relative chroma, and intensity—and compared it to HSV (fig. 1). Their model was based more upon how colors are organized and conceptualized in human vision in terms of other color-making attributes, such as hue, lightness, and chroma; as well as upon traditional color mixing methods—e.g., in painting—that involve mixing brightly colored pigments with black or white to achieve lighter, darker, or less colorful colors.

The following year, 1979, at SIGGRAPH, Tektronix introduced graphics terminals using HSL for color designation, and the Computer Graphics Standards Committee recommended it in their annual status report (fig. 7). These models were useful not only because they were more intuitive than raw RGB values, but also because the conversions to and from RGB were extremely fast to compute: they could run in real time on the hardware of the 1970s. Consequently, these models and similar ones have become ubiquitous throughout image editing and graphics software since then. Some of their uses are described below.[12][13][14][15]

Formal derivation[edit]

Fig. 8. The geometric derivation of the cylindrical HSL and HSV representations of an RGB 'colorcube'.

Color-making attributes[edit]

The dimensions of the HSL and HSV geometries—simple transformations of the not-perceptually-based RGB model—are not directly related to the photometric color-making attributes of the same names, as defined by scientists such as the CIE or ASTM. Nonetheless, it is worth reviewing those definitions before leaping into the derivation of our models.[D] For the definitions of color-making attributes which follow, see:[16][17][18][19][20][21]

Hue
The 'attribute of a visual sensation according to which an area appears to be similar to one of the perceived colors: red, yellow, green, and blue, or to a combination of two of them'.[16]
Radiance (Le,Ω)
The radiant power of light passing through a particular surface per unit solid angle per unit projected area, measured in SI units in watt per steradian per square metre (W·sr−1·m−2).
Luminance (Y or Lv,Ω)
The radiance weighted by the effect of each wavelength on a typical human observer, measured in SI units in candela per square meter (cd/m2). Often the term luminance is used for the relative luminance, Y/Yn, where Yn is the luminance of the reference white point.
Luma (Y′)
The weighted sum of gamma-correctedR, G, and B values, and used in Y′CbCr, for JPEG compression and video transmission.
Brightness
The 'attribute of a visual sensation according to which an area appears to emit more or less light'.[16]
Lightness, value
The 'brightness relative to the brightness of a similarly illuminated white'.[16]
Colorfulness
The 'attribute of a visual sensation according to which the perceived color of an area appears to be more or less chromatic'.[16]
Chroma
The 'colorfulness relative to the brightness of a similarly illuminated white'.[16]
Saturation
The 'colorfulness of a stimulus relative to its own brightness'.[16]

Brightness and colorfulness are absolute measures, which usually describe the spectral distribution of light entering the eye, while lightness and chroma are measured relative to some white point, and are thus often used for descriptions of surface colors, remaining roughly constant even as brightness and colorfulness change with different illumination. Saturation can be defined as either the ratio of colorfulness to brightness or that of chroma to lightness.

General approach[edit]

HSL, HSV, and related models can be derived via geometric strategies, or can be thought of as specific instances of a 'generalized LHS model'. The HSL and HSV model-builders took an RGB cube—with constituent amounts of red, green, and blue light in a color denoted R, G, B∈[0, 1][E]—and tilted it on its corner, so that black rested at the origin with white directly above it along the vertical axis, then measured the hue of the colors in the cube by their angle around that axis, starting with red at 0°. Then they came up with a characterization of brightness/value/lightness, and defined saturation to range from 0 along the axis to 1 at the most colorful point for each pair of other parameters.[3][10][11]

Hue and chroma[edit]

Fig. 9. Both hue and chroma are defined based on the projection of the RGB cube onto a hexagon in the 'chromaticity plane'. Chroma is the relative size of the hexagon passing through a point, and hue is how far around that hexagon's edge the point lies.

In each of our models, we calculate both hue and what this article will call chroma, after Joblove and Greenberg (1978), in the same way—that is, the hue of a color has the same numerical values in all of these models, as does its chroma. If we take our tilted RGB cube, and project it onto the 'chromaticity plane' perpendicular to the neutral axis, our projection takes the shape of a hexagon, with red, yellow, green, cyan, blue, and magenta at its corners (fig. 9). Hue is roughly the angle of the vector to a point in the projection, with red at 0°, while chroma is roughly the distance of the point from the origin.[F][G]

More precisely, both hue and chroma in this model are defined with respect to the hexagonal shape of the projection. The chroma is the proportion of the distance from the origin to the edge of the hexagon. In the lower part of the adjacent diagram, this is the ratio of lengths OP/OP, or alternately the ratio of the radii of the two hexagons. This ratio is the difference between the largest and smallest values among R, G, or B in a color. To make our definitions easier to write, we'll define these maximum, minimum, and chroma component values as M, m, and C, respectively.[H]

M=max(R,G,B)m=min(R,G,B)C=Mm{displaystyle {begin{aligned}M&=operatorname {max} (R,G,B)m&=operatorname {min} (R,G,B)C&=M-mend{aligned}}}

To understand why chroma can be written as Mm, notice that any neutral color, with R = G = B, projects onto the origin and so has 0 chroma. Thus if we add or subtract the same amount from all three of R, G, and B, we move vertically within our tilted cube, and do not change the projection. Therefore, any two colors (R, G, B) and (Rm, Gm, Bm) project on the same point, and have the same chroma. The chroma of a color with one of its components equal to zero (m = 0) is simply the maximum of the other two components. This chroma is M in the particular case of a color with a zero component, and Mm in general.

The hue is the proportion of the distance around the edge of the hexagon which passes through the projected point, originally measured on the range [0, 1] but now typically measured in degrees[0°, 360°]. For points which project onto the origin in the chromaticity plane (i.e., grays), hue is undefined. Mathematically, this definition of hue is written piecewise:[I]

H={undefined,if C=0GBCmod6,if M=RBRC+2,if M=GRGC+4,if M=BH=60×H{displaystyle {begin{aligned}H^{prime }&={begin{cases}mathrm {undefined} ,&{mbox{if }}C=0{frac {G-B}{C}};{bmod {6}},&{mbox{if }}M=R{frac {B-R}{C}}+2,&{mbox{if }}M=G{frac {R-G}{C}}+4,&{mbox{if }}M=Bend{cases}}H&=60^{circ }times H^{prime }end{aligned}}}

Sometimes, neutral colors (i.e. with C = 0) are assigned a hue of 0° for convenience of representation.

Fig. 10. The definitions of hue and chroma in HSL and HSV have the effect of warping hexagons into circles.

These definitions amount to a geometric warping of hexagons into circles: each side of the hexagon is mapped linearly onto a 60° arc of the circle (fig. 10). After such a transformation, hue is precisely the angle around the origin and chroma the distance from the origin: the angle and magnitude of the vector pointing to a color.

Fig. 11. Constructing rectangular chromaticity coordinates α and β, and then transforming those into hue H2 and chroma C2 yields slightly different values than computing hexagonal hue H and chroma C: compare the numbers in this diagram to those earlier in this section.

Sometimes for image analysis applications, this hexagon-to-circle transformation is skipped, and hue and chroma (we'll denote these H2 and C2) are defined by the usual cartesian-to-polar coordinate transformations (fig. 11). The easiest way to derive those is via a pair of cartesian chromaticity coordinates which we'll call α and β:[22][23][24]

α=RGcos(60)Bcos(60)=12(2RGB)β=Gsin(60)Bsin(60)=32(GB)H2=atan2(β,α)C2=α2+β2{displaystyle {begin{aligned}alpha &=R-Gcdot cos(60^{circ })-Bcdot cos(60^{circ })=textstyle {frac {1}{2}}(2R-G-B)beta &=Gcdot sin(60^{circ })-Bcdot sin(60^{circ })=textstyle {frac {sqrt {3}}{2}}(G-B)H_{2}&=operatorname {atan2} (beta ,alpha )C_{2}&={sqrt {alpha ^{2}+beta ^{2}}}end{aligned}}}

(The atan2 function, a 'two-argument arctangent', computes the angle from a cartesian coordinate pair.)

Notice that these two definitions of hue (H and H2) nearly coincide, with a maximum difference between them for any color of about 1.12°—which occurs at twelve particular hues, for instance H = 13.38°, H2 = 12.26°—and with H = H2 for every multiple of 30°. The two definitions of chroma (C and C2) differ more substantially: they are equal at the corners of our hexagon, but at points halfway between two corners, such as H = H2 = 30°, we have C = 1, but C2 = ¾ ≈ 0.866, a difference of about 13.4%.

Lightness[edit]

Fig. 12a–d. Four different possible 'lightness' dimensions, plotted against chroma, for a pair of complementary hues. Each plot is a vertical cross-section of its three-dimensional color solid.

While the definition of hue is relatively uncontroversial—it roughly satisfies the criterion that colors of the same perceived hue should have the same numerical hue—the definition of a lightness or value dimension is less obvious: there are several possibilities depending on the purpose and goals of the representation. Here are four of the most common (fig. 12; three of these are also shown in fig. 8):

  • The simplest definition is just the average of the three components, in the HSI model called intensity (fig. 12a). This is simply the projection of a point onto the neutral axis—the vertical height of a point in our tilted cube. The advantage is that, together with Euclidean-distance calculations of hue and chroma, this representation preserves distances and angles from the geometry of the RGB cube.[23][25]
    I=13(R+G+B){displaystyle I=textstyle {frac {1}{3}}(R+G+B),!}
  • In the HSV 'hexcone' model, value is defined as the largest component of a color, our M above (fig. 12b). This places all three primaries, and also all of the 'secondary colors'—cyan, yellow, and magenta—into a plane with white, forming a hexagonal pyramid out of the RGB cube.[10]
    V=M{displaystyle V=M,!}
  • In the HSL 'bi-hexcone' model, lightness is defined as the average of the largest and smallest color components (fig. 12c). This definition also puts the primary and secondary colors into a plane, but a plane passing halfway between white and black. The resulting color solid is a double-cone similar to Ostwald's, shown above.[11]
    L=12(M+m){displaystyle L=textstyle {frac {1}{2}}(M+m),!}
  • A more perceptually relevant alternative is to use luma, Y, as a lightness dimension (fig. 12d). Luma is the weighted average of gamma-corrected R, G, and B, based on their contribution to perceived lightness, long used as the monochromatic dimension in color television broadcast. For the Rec. 709 primaries used in sRGB, Y709 = 0.21R + 0.72G + 0.07B; for the Rec. 601NTSC primaries, Y601 ≈ 0.30R + 0.59G + 0.11B; for other primaries different coefficients should be used.[26][J]
    Y709=0.2126R+0.7152G+0.0722B{displaystyle Y_{709}^{prime }=0.2126R+0.7152G+0.0722B,!}
    Y601=0.2989R+0.5870G+0.1140B{displaystyle Y_{601}^{prime }=0.2989R+0.5870G+0.1140B,!}

All four of these leave the neutral axis alone. That is, for colors with R = G = B, any of the four formulations yields a lightness equal to the value of R, G, or B.

For a graphical comparison, see fig. 13 below.

Saturation[edit]

Fig. 14a–d. In both HSL and HSV, saturation is simply the chroma scaled to fill the interval [0, 1] for every combination of hue and lightness or value.

When encoding colors in a hue/lightness/chroma or hue/value/chroma model (using the definitions from the previous two sections) model, not all combinations of lightness (or value) and chroma are meaningful: that is, half of the colors denotable using H ∈ [0°, 360°), C ∈ [0, 1], and V ∈ [0, 1] fall outside the RGB gamut (the gray parts of the slices in figure 14). The creators of these models considered this a problem for some uses. For example, in a color selection interface with two of the dimensions in a rectangle and the third on a slider, half of that rectangle is made of unused space. Now imagine we have a slider for lightness: the user's intent when adjusting this slider is potentially ambiguous: how should the software deal with out-of-gamut colors? Or conversely, If the user has selected as colorful as possible a dark purple , and then shifts the lightness slider upward, what should be done: would the user prefer to see a lighter purple still as colorful as possible for the given hue and lightness , or a lighter purple of exactly the same chroma as the original color ?[11]

To solve problems such as these, the HSL and HSV models scale the chroma so that it always fits into the range [0, 1] for every combination of hue and lightness or value, calling the new attribute saturation in both cases (fig. 14). To calculate either, simply divide the chroma by the maximum chroma for that value or lightness.

SHSV={0,if V=0CV,otherwiseSHSL={0,if L=1L=0C12L1,otherwise{displaystyle {begin{aligned}S_{HSV}&={begin{cases}0,&{mbox{if }}{V}=0{frac {C}{V}},&{mbox{otherwise}}end{cases}}S_{HSL}&={begin{cases}0,&{mbox{if }}{L}=1lor L=0{frac {C}{1- 2L-1 }},&{mbox{otherwise}}end{cases}}end{aligned}}}
Fig. 15a–b. In HSI, saturation, shown in the slice on the right, is roughly the chroma relative to lightness. Also common is a model with dimensions I, H2, C2, shown in the slice on the left. Notice that the hue in these slices is the same as the hue above, but H differs slightly from H2.

The HSI model commonly used for computer vision, which takes H2 as a hue dimension and the component average I ('intensity') as a lightness dimension, does not attempt to 'fill' a cylinder by its definition of saturation. Instead of presenting color choice or modification interfaces to end users, the goal of HSI is to facilitate separation of shapes in an image. Saturation is therefore defined in line with the psychometric definition: chroma relative to lightness (fig. 15). See the Use in image analysis section of this article.[28]

SHSI={0,if I=01mI,otherwise{displaystyle S_{HSI}={begin{cases}0,&{mbox{if }}{I}=01-{frac {m}{I}},&{mbox{otherwise}}end{cases}}}

Using the same name for these three different definitions of saturation leads to some confusion, as the three attributes describe substantially different color relationships; in HSV and HSI, the term roughly matches the psychometric definition, of a chroma of a color relative to its own lightness, but in HSL it does not come close. Even worse, the word saturation is also often used for one of the measurements we call chroma above (C or C2).

Examples[edit]

All parameter values shown below are in the interval[0, 1], except those for H and H2 which are in the interval [0°, 360°].[K]

ColorRGBHH2CC2VLIY′601SHSVSHSLSHSI
#FFFFFF1.0001.0001.000n/an/a0.0000.0001.0001.0001.0001.0000.0000.0000.000
#8080800.5000.5000.500n/an/a0.0000.0000.5000.5000.5000.5000.0000.0000.000
#0000000.0000.0000.000n/an/a0.0000.0000.0000.0000.0000.0000.0000.0000.000
#FF00001.0000.0000.0000.0°0.0°1.0001.0001.0000.5000.3330.2991.0001.0001.000
#BFBF000.7500.7500.00060.0°60.0°0.7500.7500.7500.3750.5000.6641.0001.0001.000
#0080000.0000.5000.000120.0°120.0°0.5000.5000.5000.2500.1670.2931.0001.0001.000
#80FFFF0.5001.0001.000180.0°180.0°0.5000.5001.0000.7500.8330.8500.5001.0000.400
#8080FF0.5000.5001.000240.0°240.0°0.5000.5001.0000.7500.6670.5570.5001.0000.250
#BF40BF0.7500.2500.750300.0°300.0°0.5000.5000.7500.5000.5830.4570.6670.5000.571
#A0A4240.6280.6430.14261.8°61.5°0.5010.4940.6430.3930.4710.5810.7790.6380.699
#411BEA0.2550.1040.918251.1°250.0°0.8140.7500.9180.5110.4260.2420.8870.8320.756
#1EAC410.1160.6750.255134.9°133.8°0.5590.5040.6750.3960.3490.4600.8280.7070.667
#F0C80E0.9410.7850.05349.5°50.5°0.8880.8210.9410.4980.5930.7480.9440.8930.911
#B430E50.7040.1870.897283.7°284.8°0.7100.6360.8970.5430.5960.4230.7920.7750.686
#ED76510.9310.4630.31614.3°13.2°0.6150.5560.9310.6240.5700.5860.6610.8170.446
#FEF8880.9980.9740.53256.9°57.4°0.4660.4540.9980.7650.8350.9310.4670.9910.363
#19CB970.0990.7950.591162.4°163.4°0.6960.6200.7950.4470.4950.5640.8750.7790.800
#3626980.2110.1490.597248.3°247.3°0.4480.4200.5970.3730.3190.2190.7500.6010.533
#7E7EB80.4950.4930.721240.5°240.4°0.2280.2270.7210.6080.5700.5200.3160.2900.135

Use in end-user software[edit]

Fig 16a–g. By the 1990s, HSL and HSV color selection tools were ubiquitous. The screenshots above are taken from:
· (a) SGI IRIX 5, c. 1995;
· (b) Adobe Photoshop, c. 1990;
· (c) IBM OS/2 Warp 3, c. 1994;
· (d) Apple Macintosh System 7, c. 1996;
· (e) Fractal Design Painter, c. 1993;
· (f) Microsoft Windows 3.1, c. 1992;
· (g) NeXTSTEP, c. 1995.
These are undoubtedly based on earlier examples, stretching back to PARC and NYIT in the mid-1970s.[L]

The original purpose of HSL and HSV and similar models, and their most common current application, is in color selection tools. At their simplest, some such color pickers provide three sliders, one for each attribute. Most, however, show a two-dimensional slice through the model, along with a slider controlling which particular slice is shown. The latter type of GUI exhibits great variety, because of the choice of cylinders, hexagonal prisms, or cones/bicones that the models suggest (see the diagram near the top of the page). Several color choosers from the 1990s are shown to the right, most of which have remained nearly unchanged in the intervening time: today, nearly every computer color chooser uses HSL or HSV, at least as an option. Some more sophisticated variants are designed for choosing whole sets of colors, basing their suggestions of compatible colors on the HSL or HSV relationships between them.[M]

Most web applications needing color selection also base their tools on HSL or HSV, and pre-packaged open source color choosers exist for most major web front-end frameworks. The CSS 3 specification allows web authors to specify colors for their pages directly with HSL coordinates.[N][29]

HSL and HSV are sometimes used to define gradients for data visualization, as in maps or medical images. For example, the popular GIS program ArcGIS historically applied customizable HSV-based gradients to numerical geographical data.[O]

Fig. 17. xv's HSV-based color modifier.
Fig. 18. The hue/saturation tool in Photoshop 2.5, ca. 1992.

Image editing software also commonly includes tools for adjusting colors with reference to HSL or HSV coordinates, or to coordinates in a model based on the 'intensity' or luma defined above. In particular, tools with a pair of 'hue' and 'saturation' sliders are commonplace, dating to at least the late-1980s, but various more complicated color tools have also been implemented. For instance, the Unix image viewer and color editor xv allowed six user-definable hue (H) ranges to be rotated and resized, included a dial-like control for saturation (SHSV), and a curves-like interface for controlling value (V)—see fig. 17. The image editor Picture Window Pro includes a 'color correction' tool which affords complex remapping of points in a hue/saturation plane relative to either HSL or HSV space.[P]

Video editors also use these models. For example, both Avid and Final Cut Pro include color tools based on HSL or a similar geometry for use adjusting the color in video. With the Avid tool, users pick a vector by clicking a point within the hue/saturation circle to shift all the colors at some lightness level (shadows, mid-tones, highlights) by that vector.

Since version 4.0, Adobe Photoshop's 'Luminosity', 'Hue', 'Saturation', and 'Color' blend modes composite layers using a luma/chroma/hue color geometry. These have been copied widely, but several imitators use the HSL (e.g. PhotoImpact, Paint Shop Pro) or HSV (e.g. GIMP) geometries instead.[Q]

Use in image analysis[edit]

HSL, HSV, HSI, or related models are often used in computer vision and image analysis for feature detection or image segmentation. The applications of such tools include object detection, for instance in robot vision; object recognition, for instance of faces, text, or license plates; content-based image retrieval; and analysis of medical images.[28]

For the most part, computer vision algorithms used on color images are straightforward extensions to algorithms designed for grayscale images, for instance k-means or fuzzyclustering of pixel colors, or cannyedge detection. At the simplest, each color component is separately passed through the same algorithm. It is important, therefore, that the features of interest can be distinguished in the color dimensions used. Because the R, G, and B components of an object's color in a digital image are all correlated with the amount of light hitting the object, and therefore with each other, image descriptions in terms of those components make object discrimination difficult. Descriptions in terms of hue/lightness/chroma or hue/lightness/saturation are often more relevant.[28]

Starting in the late 1970s, transformations like HSV or HSI were used as a compromise between effectiveness for segmentation and computational complexity. They can be thought of as similar in approach and intent to the neural processing used by human color vision, without agreeing in particulars: if the goal is object detection, roughly separating hue, lightness, and chroma or saturation is effective, but there is no particular reason to strictly mimic human color response. John Kender's 1976 master's thesis proposed the HSI model. Ohta et al. (1980) instead used a model made up of dimensions similar to those we have called I, α, and β. In recent years, such models have continued to see wide use, as their performance compares favorably with more complex models, and their computational simplicity remains compelling.[R][28][34][35][36]

Disadvantages[edit]

Fig 20a. The sRGB gamut mapped in CIELAB space. Notice that the lines pointing to the red, green, and blue primaries are not evenly spaced by hue angle, and are of unequal length. The primaries also have different L* values.
Fig 20b. The Adobe RGB gamut mapped in CIELAB space. Also notice that these two RGB spaces have different gamuts, and thus will have different HSL and HSV representations.

While HSL, HSV, and related spaces serve well enough to, for instance, choose a single color, they ignore much of the complexity of color appearance. Essentially, they trade off perceptual relevance for computation speed, from a time in computing history (high-end 1970s graphics workstations, or mid-1990s consumer desktops) when more sophisticated models would have been too computationally expensive.[S]

HSL and HSV are simple transformations of RGB which preserve symmetries in the RGB cube unrelated to human perception, such that its R, G, and B corners are equidistant from the neutral axis, and equally spaced around it. If we plot the RGB gamut in a more perceptually-uniform space, such as CIELAB (see below), it becomes immediately clear that the red, green, and blue primaries do not have the same lightness or chroma, or evenly spaced hues. Furthermore, different RGB displays use different primaries, and so have different gamuts. Because HSL and HSV are defined purely with reference to some RGB space, they are not absolute color spaces: to specify a color precisely requires reporting not only HSL or HSV values, but also the characteristics of the RGB space they are based on, including the gamma correction in use.

If we take an image and extract the hue, saturation, and lightness or value components, and then compare these to the components of the same name as defined by color scientists, we can quickly see the difference, perceptually. For example, examine the following images of a fire breather (fig. 13). The original is in the sRGB colorspace. CIELAB L* is a CIE-defined achromatic lightness quantity (dependent solely on the perceptually achromatic luminance Y, but not the mixed-chromatic components X or Z, of the CIEXYZ colorspace from which the sRGB colorspace itself is derived), and it is plain that this appears similar in perceptual lightness to the original color image. Luma is roughly similar, but differs somewhat at high chroma, where it deviates most from depending solely on the true achromatic luminance (Y, or equivalently L*) and is influenced by the colorimetric chromaticity (x,y, or equivalently, a*,b* of CIELAB). HSL L and HSV V, by contrast, diverge substantially from perceptual lightness.

Fig. 13a. Color photograph (sRGB colorspace).
Fig. 13b. CIELAB L* (further transformed back to sRGB for consistent display).
Fig. 13c. Rec. 601 luma Y'.
Fig. 13d. Component average: 'intensity' I.
Fig. 13e. HSV value V.
Fig. 13f. HSL lightness L.

Though none of the dimensions in these spaces match their perceptual analogs, the value of HSV and the saturation of HSL are particular offenders. In HSV, the blue primary and white are held to have the same value, even though perceptually the blue primary has somewhere around 10% of the luminance of white (the exact fraction depends on the particular RGB primaries in use). In HSL, a mix of 100% red, 100% green, 90% blue—that is, a very light yellow —is held to have the same saturation as the green primary , even though the former color has almost no chroma or saturation by the conventional psychometric definitions. Such perversities led Cynthia Brewer, expert in color scheme choices for maps and information displays, to tell the American Statistical Association:

Computer science offers a few poorer cousins to these perceptual spaces that may also turn up in your software interface, such as HSV and HLS. They are easy mathematical transformations of RGB, and they seem to be perceptual systems because they make use of the hue–lightness/value–saturation terminology. But take a close look; don't be fooled. Perceptual color dimensions are poorly scaled by the color specifications that are provided in these and some other systems. For example, saturation and lightness are confounded, so a saturation scale may also contain a wide range of lightnesses (for example, it may progress from white to green which is a combination of both lightness and saturation). Likewise, hue and lightness are confounded so, for example, a saturated yellow and saturated blue may be designated as the same 'lightness' but have wide differences in perceived lightness. These flaws make the systems difficult to use to control the look of a color scheme in a systematic manner. If much tweaking is required to achieve the desired effect, the system offers little benefit over grappling with raw specifications in RGB or CMY.[37]

If these problems make HSL and HSV problematic for choosing colors or color schemes, they make them much worse for image adjustment. HSL and HSV, as Brewer mentioned, confound perceptual color-making attributes, so that changing any dimension results in non-uniform changes to all three perceptual dimensions, and distorts all of the color relationships in the image. For instance, rotating the hue of a pure dark blue toward green will also reduce its perceived chroma, and increase its perceived lightness (the latter is grayer and lighter), but the same hue rotation will have the opposite impact on lightness and chroma of a lighter bluish-green— to (the latter is more colorful and slightly darker). In the example below (fig. 21), the image on the left (a) is the original photograph of a green turtle. In the middle image (b), we have rotated the hue (H) of each color by −30°, while keeping HSV value and saturation or HSL lightness and saturation constant. In the image on the right (c), we make the same rotation to the HSL/HSV hue of each color, but then we force the CIELAB lightness (L*, a decent approximation of perceived lightness) to remain constant. Notice how the hue-shifted middle version without such a correction dramatically changes the perceived lightness relationships between colors in the image. In particular, the turtle's shell is much darker and has less contrast, and the background water is much lighter.

Fig. 21a. Color photograph.
Fig. 21b. HSL/HSV hue of each color shifted by −30°.
Fig. 21c. Hue shifted but CIELAB lightness (L*) kept as in the original.

Because hue is a circular quantity, represented numerically with a discontinuity at 360°, it is difficult to use in statistical computations or quantitative comparisons: analysis requires the use of circular statistics.[38] Furthermore, hue is defined piecewise, in 60° chunks, where the relationship of lightness, value, and chroma to R, G, and B depends on the hue chunk in question. This definition introduces discontinuities, corners which can plainly be seen in horizontal slices of HSL or HSV.[39]

Charles Poynton, digital video expert, lists the above problems with HSL and HSV in his Color FAQ, and concludes that:

HSB and HLS were developed to specify numerical Hue, Saturation and Brightness (or Hue, Lightness and Saturation) in an age when users had to specify colors numerically. The usual formulations of HSB and HLS are flawed with respect to the properties of color vision. Now that users can choose colors visually, or choose colors related to other media (such as PANTONE), or use perceptually-based systems like L*u*v* and L*a*b*, HSB and HLS should be abandoned.[40]

Other cylindrical-coordinate color models[edit]

The creators of HSL and HSV were far from the first to imagine colors fitting into conic or spherical shapes, with neutrals running from black to white in a central axis, and hues corresponding to angles around that axis. Similar arrangements date back to the 18th century, and continue to be developed in the most modern and scientific models.

Color conversion formulae[edit]

To convert from HSL or HSV to RGB, we essentially invert the steps listed above (as before, R, G, B∈[0, 1]). First, we compute chroma, by multiplying saturation by the maximum chroma for a given lightness or value. Next, we find the point on one of the bottom three faces of the RGB cube which has the same hue and chroma as our color (and therefore projects onto the same point in the chromaticity plane). Finally, we add equal amounts of R, G, and B to reach the proper lightness or value.[G]

To RGB[edit]

HSL to RGB[edit]

Given a color with hue H ∈ [0°, 360°], saturation SHSL ∈ [0, 1], and lightness L ∈ [0, 1], we first find chroma:

C=(12L1)×SHSL{displaystyle C={begin{aligned}(1-leftvert 2L-1rightvert )times S_{mathit {HSL}}end{aligned}}}

Then we can find a point (R1, G1, B1) along the bottom three faces of the RGB cube, with the same hue and chroma as our color (using the intermediate value X for the second largest component of this color):

H=H60X=C×(1Hmod21){displaystyle {begin{aligned}H^{prime }&={frac {H}{60^{circ }}}X&=Ctimes (1- H^{prime };{bmod {2}}-1 )end{aligned}}}
(R1,G1,B1)={(0,0,0)if H is undefined(C,X,0)if 0H1(X,C,0)if 1H2(0,C,X)if 2H3(0,X,C)if 3H4(X,0,C)if 4H5(C,0,X)if 5H6{displaystyle (R_{1},G_{1},B_{1})={begin{cases}(0,0,0)&{text{if }}H{text{ is undefined}}(C,X,0)&{text{if }}0leq H^{prime }leq 1(X,C,0)&{text{if }}1leq H^{prime }leq 2(0,C,X)&{text{if }}2leq H^{prime }leq 3(0,X,C)&{text{if }}3leq H^{prime }leq 4(X,0,C)&{text{if }}4leq H^{prime }leq 5(C,0,X)&{text{if }}5leq H^{prime }leq 6end{cases}}}

Overlap (when H{displaystyle H^{prime }} is an integer) occurs because two ways to calculate the value are equivalent: X=0{displaystyle X=0} or X=C{displaystyle X=C}, as appropriate.

Finally, we can find R, G, and B by adding the same amount to each component, to match lightness:

m=LC/2(R,G,B)=(R1+m,G1+m,B1+m){displaystyle {displaystyle {begin{aligned}&m=L-C/2&(R,G,B)=(R_{1}+m,G_{1}+m,B_{1}+m)end{aligned}}}}

HSL to RGB alternative[edit]

The polygonal piecewise functions can be somewhat simplified by a clever use of minimum and maximum values as well as the remainder operation.

Given a color with hue H[0,360]{displaystyle Hin [0^{circ },360^{circ }]}, saturation S=SHSL[0,1]{displaystyle S=S_{HSL}in [0,1]}, and lightness L[0,1]{displaystyle Lin [0,1]}, first we define function :

f(n)=Lamax(min(k3,9k,1),1){displaystyle f(n)=L-amax(min(k-3,9-k,1),-1)}

where k,nR0{displaystyle k,nin mathbb {R} _{geq 0}} and:

k=(n+H30)mod12a=Smin(L,1L){displaystyle {begin{aligned}k&=(n+{frac {H}{30^{circ }}}){bmod {1}}2a&=Smin(L,1-L)end{aligned}}}

And output R,G,B values (from [0,1]3{displaystyle [0,1]^{3}}) are:

(R,G,B)=(f(0),f(8),f(4)){displaystyle (R,G,B)=(f(0),f(8),f(4))}

Explanation of HSL to RGB alternative

Above alternative equivalent formulas allow shorter implementation - here is proof of concept in javascript. In above formulas the amodb{displaystyle a{bmod {b}}} returns also fractional part of module e.g. the formula 7.4mod6=1.4{displaystyle 7.4{bmod {6}}=1.4}. The values of kRk[0,12){displaystyle kin mathbb {R} land kin [0,12)}.

The base shape T(k)=t(n,H)=max(min(k3,9k,1),1){displaystyle T(k)=t(n,H)=max(min(k-3,9-k,1),-1)} is constructed as follows: t1=min(k3,9k){displaystyle t1=min(k-3,9-k)} is 'triangle' for which values greater or equal -1 starts from k=2 and ends for k=10, highest point is at k=6. Then by t2=min(t1,1)=min(k3,9k,1){displaystyle t2=min(t1,1)=min(k-3,9-k,1)} we change values bigger than 1 to exact 1. Then by t=max(t2,1){displaystyle t=max(t2,-1)} we change values less than -1 to exact -1. At this point we get something similar to red shape from fig. 24 after vertical flip (which max value is 1 and min value is -1). The R,G,B functions of H{displaystyle H} use this shape transformed in following way: modulo-shifted on X{displaystyle X} (by n{displaystyle n}) (differently for R,G,B) scaled on Y{displaystyle Y} (by a{displaystyle -a}) and shifted on Y{displaystyle Y} (by L{displaystyle L}).

We observe following shape properties (Fig. 24 can help to get intuition about them):

t(n,H)=t(n+6,H)1=min(t(n,H),t(n+4,H),t(n+8,H))1=max(t(n,H),t(n+4,H),t(n+8,H)){displaystyle {begin{aligned}t(n,H)&=-t(n+6,H)-1&=min (t(n,H),t(n+4,H),t(n+8,H))1&=max (t(n,H),t(n+4,H),t(n+8,H))end{aligned}}}

HSV to RGB[edit]

Fig. 24. A graphical representation of RGB coordinates given values for HSV. This equation V(1S)=VVS{displaystyle V(1-S)=V-VS} shows origin of marked vertical axis values

Given an HSV color with hue H ∈ [0°, 360°], saturation SHSV ∈ [0, 1], and value V ∈ [0, 1], we can use the same strategy. First, we find chroma:

C=V×SHSV{displaystyle C=Vtimes S_{mathit {HSV}},!}

Then we can, again, find a point (R1, G1, B1) along the bottom three faces of the RGB cube, with the same hue and chroma as our color (using the intermediate value X for the second largest component of this color):

H=H60X=C×(1Hmod21){displaystyle {begin{aligned}H^{prime }&={frac {H}{60^{circ }}}X&=Ctimes (1- H^{prime };{bmod {2}}-1 )end{aligned}}}
(R1,G1,B1)={(0,0,0)if H is undefined(C,X,0)if 0H1(X,C,0)if 1<H2(0,C,X)if 2<H3(0,X,C)if 3<H4(X,0,C)if 4<H5(C,0,X)if 5<H6{displaystyle (R_{1},G_{1},B_{1})={begin{cases}(0,0,0)&{text{if }}H{text{ is undefined}}(C,X,0)&{text{if }}0leq H^{prime }leq 1(X,C,0)&{text{if }}1<H^{prime }leq 2(0,C,X)&{text{if }}2<H^{prime }leq 3(0,X,C)&{text{if }}3<H^{prime }leq 4(X,0,C)&{text{if }}4<H^{prime }leq 5(C,0,X)&{text{if }}5<H^{prime }leq 6end{cases}}}

Overlap (when H{displaystyle H^{prime }} is an integer) occurs because two ways to calculate the value are equivalent: X=0{displaystyle X=0} or X=C{displaystyle X=C}, as appropriate.

Finally, we can find R, G, and B by adding the same amount to each component, to match value:

m=VC(R,G,B)=(R1+m,G1+m,B1+m){displaystyle {begin{aligned}&m=V-C&(R,G,B)=(R_{1}+m,G_{1}+m,B_{1}+m)end{aligned}}}

HSV to RGB alternative[edit]

Given a color with hue H[0,360]{displaystyle Hin [0^{circ },360^{circ }]}, saturation S=SHSV[0,1]{displaystyle S=S_{HSV}in [0,1]}, and value V[0,1]{displaystyle Vin [0,1]}, first we define function :

f(n)=VVSmax(min(k,4k,1),0){displaystyle f(n)=V-VSmax(min(k,4-k,1),0)}

where k,nR0{displaystyle k,nin mathbb {R} _{geq 0}} and:

k=(n+H60)mod6{displaystyle {begin{aligned}k&=(n+{frac {H}{60^{circ }}}){bmod {6}}end{aligned}}}

And output R,G,B values (from [0,1]3{displaystyle [0,1]^{3}}) are:

(R,G,B)=(f(5),f(3),f(1)){displaystyle (R,G,B)=(f(5),f(3),f(1))}

Explanation of HSV to RGB alternative

Above alternative equivalent formulas allow shorter implementation - here is proof of concept in javascript. In above formulas the amodb{displaystyle a{bmod {b}}} returns also fractional part of module e.g. the formula 7.4mod6=1.4{displaystyle 7.4{bmod {6}}=1.4}. The values of kRk[0,6){displaystyle kin mathbb {R} land kin [0,6)}. The base shape

t(n,H)=T(k)=max(min(k,4k,1),0){displaystyle t(n,H)=T(k)=max(min(k,4-k,1),0)}

is constructed as follows: t1=min(k,4k){displaystyle t1=min(k,4-k)} is 'triangle' for which non-negative values starts from k=0, highest point at k=2 and 'ends' at k=4, then we change values bigger than one to one by t2=min(t1,1)=min(k,4k,1){displaystyle t2=min(t1,1)=min(k,4-k,1)}, then change negative values to zero by t=max(t2,0){displaystyle t=max(t2,0)} - and we get (for n=0{displaystyle n=0}) something similar to green shape from Fig. 24 (which max value is 1 and min value is 0). The R,G,B functions of H{displaystyle H} use this shape transformed in following way: modulo-shifted on X{displaystyle X} (by n{displaystyle n}) (differently for R,G,B) scaled on Y{displaystyle Y} (by VS{displaystyle -VS}) and shifted on Y{displaystyle Y} (by V{displaystyle V}). We observe following shape properties(Fig. 24 can help to get intuition about this):

t(n,H)=1t(n+3,H)0=min(t(n,H),t(n+2,H),t(n+4,H))1=max(t(n,H),t(n+2,H),t(n+4,H)){displaystyle {begin{aligned}t(n,H)&=1-t(n+3,H)0&=mathrm {mi} n(t(n,H),t(n+2,H),t(n+4,H))1&=max(t(n,H),t(n+2,H),t(n+4,H))end{aligned}}}

HSI to RGB[edit]

Given an HSI color with hue H ∈ [0°, 360°], saturation SHSI ∈ [0, 1], and intensity I ∈ [0, 1], we can use the same strategy, in a slightly different order:

H=H60Z=1Hmod21C=3ISHSI1+ZX=CZ{displaystyle {begin{aligned}H^{prime }&={frac {H}{60^{circ }}}Z&=1- H^{prime };{bmod {2}}-1 C&={frac {3cdot Icdot S_{HSI}}{1+Z}}X&=Ccdot Zend{aligned}}}

Where C{displaystyle C} is the chroma.

Then we can, again, find a point (R1, G1, B1) along the bottom three faces of the RGB cube, with the same hue and chroma as our color (using the intermediate value X for the second largest component of this color):

(R1,G1,B1)={(0,0,0)if H is undefined(C,X,0)if 0H1(X,C,0)if 1H2(0,C,X)if 2H3(0,X,C)if 3H4(X,0,C)if 4H5(C,0,X)if 5H<6{displaystyle (R_{1},G_{1},B_{1})={begin{cases}(0,0,0)&{text{if }}H{text{ is undefined}}(C,X,0)&{text{if }}0leq H^{prime }leq 1(X,C,0)&{text{if }}1leq H^{prime }leq 2(0,C,X)&{text{if }}2leq H^{prime }leq 3(0,X,C)&{text{if }}3leq H^{prime }leq 4(X,0,C)&{text{if }}4leq H^{prime }leq 5(C,0,X)&{text{if }}5leq H^{prime }<6end{cases}}}

Overlap (when H{displaystyle H^{prime }} is an integer) occurs because two ways to calculate the value are equivalent: X=0{displaystyle X=0} or X=C{displaystyle X=C}, as appropriate.

Finally, we can find R, G, and B by adding the same amount to each component, to match lightness:

m=I(1SHSI)(R,G,B)=(R1+m,G1+m,B1+m){displaystyle {begin{aligned}&m=Icdot (1-S_{HSI})&(R,G,B)=(R_{1}+m,G_{1}+m,B_{1}+m)end{aligned}}}

Luma/chroma/hue to RGB[edit]

Given a color with hue H ∈ [0°, 360°], chroma C ∈ [0, 1], and luma Y601 ∈ [0, 1],[T] we can again use the same strategy. Since we already have H and C, we can straightaway find our point (R1, G1, B1) along the bottom three faces of the RGB cube:

H=H60X=C×(1Hmod21){displaystyle {begin{aligned}H^{prime }&={frac {H}{60^{circ }}}X&=Ctimes (1- H^{prime };{bmod {2}}-1 )end{aligned}}}
(R1,G1,B1)={(0,0,0)if H is undefined(C,X,0)if 0H1(X,C,0)if 1H2(0,C,X)if 2H3(0,X,C)if 3H4(X,0,C)if 4H5(C,0,X)if 5H<6{displaystyle (R_{1},G_{1},B_{1})={begin{cases}(0,0,0)&{text{if }}H{text{ is undefined}}(C,X,0)&{text{if }}0leq H^{prime }leq 1(X,C,0)&{text{if }}1leq H^{prime }leq 2(0,C,X)&{text{if }}2leq H^{prime }leq 3(0,X,C)&{text{if }}3leq H^{prime }leq 4(X,0,C)&{text{if }}4leq H^{prime }leq 5(C,0,X)&{text{if }}5leq H^{prime }<6end{cases}}}

Overlap (when H{displaystyle H^{prime }} is an integer) occurs because two ways to calculate the value are equivalent: X=0{displaystyle X=0} or X=C{displaystyle X=C}, as appropriate.

Then we can find R, G, and B by adding the same amount to each component, to match luma:

m=Y601(.30R1+.59G1+.11B1)(R,G,B)=(R1+m,G1+m,B1+m){displaystyle {begin{aligned}&m=Y_{601}^{prime }-(.30R_{1}+.59G_{1}+.11B_{1})&(R,G,B)=(R_{1}+m,G_{1}+m,B_{1}+m)end{aligned}}}

Interconversion[edit]

HSV to HSL[edit]

How to use hsv

Given a color with hue HHSV[0,360]{displaystyle H_{HSV}in [0^{circ },360^{circ }]}, saturation SHSV[0,1]{displaystyle S_{HSV}in [0,1]}, and value V[0,1]{displaystyle Vin [0,1]},

HHSL=HHSVL=VVSHSV/2SHSL={0if L=0 or 1(VL)/min(L,1L)otherwise{displaystyle {begin{aligned}H_{HSL}&=H_{HSV}L&=V-VS_{HSV}/2S_{HSL}&={begin{cases}0&{text{if }}L=0{text{ or }}1(V-L)/min(L,1-L)&{text{otherwise}}end{cases}}end{aligned}}}

Example implementation in javascript and error analysis.

HSL to HSV[edit]

Given a color with hue HHSL[0,360]{displaystyle H_{HSL}in [0^{circ },360^{circ }]}, saturation SHSL[0,1]{displaystyle S_{HSL}in [0,1]}, and luminance L[0,1]{displaystyle Lin [0,1]},

HHSV=HHSLV=L+SHSLmin(L,1L)SHSV={0if V=022L/Votherwise{displaystyle {begin{aligned}H_{HSV}&=H_{HSL}V&=L+S_{HSL}min(L,1-L)S_{HSV}&={begin{cases}0&{text{if }}V=02-2L/V&{text{otherwise}}end{cases}}end{aligned}}}

Example implementation in javascript and error analysis.

From RGB[edit]

This is a reiteration of the previous conversion.

Value must be in range R,G,B[0,1]{displaystyle R,G,Bin [0,1]}.

H:={0,ifMAX=MINR=G=B60(0+GBMAXMIN),ifMAX=R60(2+BRMAXMIN),ifMAX=G60(4+RGMAXMIN),ifMAX=B{displaystyle H:={begin{cases}0,&{text{if}};MAX=MINLeftrightarrow R=G=B60^{circ }cdot left(0+{frac {G-B}{MAX-MIN}}right),&{text{if}};MAX=R60^{circ }cdot left(2+{frac {B-R}{MAX-MIN}}right),&{text{if}};MAX=G60^{circ }cdot left(4+{frac {R-G}{MAX-MIN}}right),&{text{if}};MAX=Bend{cases}}}

ifH<0thenH:=H+360{displaystyle {text{if}};H<0^{circ };{text{then}};H:=H+360^{circ }}

SHSV:={0,ifMAX=0R=G=B=0MAXMINMAX,otherwise{displaystyle {displaystyle S_{mathrm {HSV} }:={begin{cases}0,&{text{if}};MAX=0Leftrightarrow R=G=B=0{frac {MAX-MIN}{MAX}},&{text{otherwise}}end{cases}}}}

SHSL:={0,ifMAX=0R=G=B=00,ifMIN=1R=G=B=1MAXMIN1MAX+MIN1=2MAX2L12L1=MAXLmin(L,1L),otherwise{displaystyle {displaystyle S_{mathrm {HSL} }:={begin{cases}0,&{text{if}};MAX=0Leftrightarrow R=G=B=00,&{text{if}};MIN=1Leftrightarrow R=G=B=1{frac {MAX-MIN}{1-leftvert MAX+MIN-1rightvert }}={frac {2MAX-2L}{1-leftvert 2L-1rightvert }}={frac {MAX-L}{mathrm {mi} n(L,1-L)}},&{text{otherwise}}end{cases}}}}

V:=MAX{displaystyle V:=MAX}

L:=MAX+MIN2{displaystyle L:={frac {MAX+MIN}{2}}}

Swatches[edit]

Mouse over the swatches below to see the R, G, and B values for each swatch in a tooltip.

HSL[edit]

H = 180°
(Cyan)
H = 0°
(Red)
S
1¾½¼0¼½¾1
1
¾
½
¼
0
H = 210°
(Blue-Cyan)
H = 30°
(Yellow-Red)
S
1¾½¼0¼½¾1
1
¾
½
¼
0
H = 240°
(Blue)
H = 60°
(Yellow)
S
1¾½¼0¼½¾1
1
¾
½
¼
0
H = 270°
(Magenta-Blue)
H = 90°
(Green-Yellow)
S
1¾½¼0¼½¾1
1
¾
½
¼
0
H = 300°
(Magenta)
H = 120°
(Green)
S
1¾½¼0¼½¾1
1
¾
½
¼
0
H = 330°
(Red-Magenta)
H = 150°
(Cyan-Green)
S
1¾½¼0¼½¾1
1
¾
½
¼
0


HSV[edit]

H = 180°
(Cyan)
H = 0°
(Red)
S
1¾½¼0¼½¾1
1
¾
½
¼
0
H = 210°
(Blue-Cyan)
H = 30°
(Yellow-Red)
S
1¾½¼0¼½¾1
1
¾
½
¼
0
H = 240°
(Blue)
H = 60°
(Yellow)
S
1¾½¼0¼½¾1
1
¾
½
¼
0
H = 270°
(Magenta-Blue)
H = 90°
(Green-Yellow)
S
1¾½¼0¼½¾1
1
¾
½
¼
0
H = 300°
(Magenta)
H = 120°
(Green)
S
1¾½¼0¼½¾1
1
¾
½
¼
0
H = 330°
(Red-Magenta)
H = 150°
(Cyan-Green)
S
1¾½¼0¼½¾1
1
¾
½
¼
0


Notes[edit]

  1. ^The Joblove and Greenberg (1978) paper first introducing HSL, they called HSL lightness 'intensity', called HSL saturation 'relative chroma', called HSV saturation 'saturation' and called HSV value 'value'. They carefully and unambiguously described and compared three models: hue/chroma/intensity, hue/relative chroma/intensity, and hue/value/saturation. Unfortunately, later authors were less fastidious, and current usage of these terms is inconsistent and often misleading.
  2. ^The name hexcone for hexagonal pyramid was coined in Smith (1978), and stuck.
  3. ^For instance, a 1982 study by Berk, et al., found that users were better at describing colors in terms of HSL than RGB coordinates, after being taught both systems, but were much better still at describing them in terms of the natural-language CNS model (which uses names such as 'very dark grayish yellow-green' or 'medium strong bluish purple'). This shouldn't be taken as gospel however: a 1987 study by Schwarz, et al., found that users could match colors using RGB controls faster than with HSL controls; a 1999 study by Douglas and Kirkpatrick found that the visual feedback in the user interface mattered more than the particular color model in use, for user matching speed.[7][8][9]
  4. ^'Clearly, if color appearance is to be described in a systematic, mathematical way, definitions of the phenomena being described need to be precise and universally agreed upon.'[16]
  5. ^In Levkowitz and Herman’s formulation, R, G, and B stand for the voltages on the guns of a CRT display, which might have different maxima, and so their cartesian gamut could be a box of any unequal dimensions. Other definitions commonly use integer values in the range [0, 255], storing the value for each component in one byte. We define the RGB gamut to be a unit cube for convenience because it simplifies and clarifies the math. Also, in general, HSL and HSV are today computed directly from gamma-correctedR, G, and B—for instance in sRGB space—but, when the models were developed, might have been transformations of a linear RGB space. Early authors don’t address gamma correction at all, except Alvy Ray Smith[10] who clearly states that 'We shall assume that an RGB monitor is a linear device', and thus designed HSV using linear RGB. We will drop the primes, and the labels R, G, and B should be taken to stand for the three attributes of the origin RGB space, whether or not it is gamma corrected.
  6. ^Using the chroma here not only agrees with the original Joblove and Greenberg (1978) paper, but is also in the proper spirit of the psychometric definition of the term. Some models call this attribute saturation—for instance Adobe Photoshop's 'Saturation' blend mode—but such use is even more confusing than the use of the term in HSL or HSV, especially when two substantially different definitions are used side by side.
  7. ^ abMost of the computer graphics papers and books discussing HSL or HSV have a formula or algorithm describing them formally. Our formulas which follow are some mix of those. See, for instance, Agoston (2005) or Foley (1995)
  8. ^Hanbury and Serra (2002) put a great deal of effort into explaining why what we call chroma here can be written as max(R, G, B) − min(R, G, B), and showing that this value is a seminorm. They reserve the name chroma for the Euclideannorm in the chromaticity plane (our C2), and call this hexagonal distance saturation instead, as part of their IHLS model
  9. ^In the following, the multiplication of hue by 60°—that is, 360°/6—can be seen as the hexagonal-geometry analogue of the conversion from radians to degrees, a multiplication by 360°/2π: the circumference of a unit circle is 2π; the circumference of a unit hexagon is 6.
  10. ^For a more specific discussion of the term luma, see Charles Poynton (2008). See also RGB color space#Specifications. Photoshop exclusively uses the NTSC coefficients for its 'Luminosity' blend mode regardless of the RGB color space involved.[27]
  11. ^The first nine colors in this table were chosen by hand, and the last ten colors were chosen at random.
  12. ^See Smith (1978). Many of these screenshots were taken from the GUIdebook, and the rest were gathered from image search results.
  13. ^For instance, a tool in Illustrator CS4, and Adobe's related web tool, Kuler, both allow users to define color schemes based on HSV relationships, but with a hue circle modified to better match the RYB model used traditionally by painters. The web tools ColorJack, Color Wizard, and ColorBlender all pick color schemes with reference to HSL or HSV.
  14. ^Try a web search for 'framework name' color picker' for examples for a given framework, or 'JavaScript color picker' for general results.
  15. ^ArcGIS calls its map-symbol gradients 'color ramps'. Current versions of ArcGIS can use CIELAB instead for defining them.[30]
  16. ^For instance, the first version of Photoshop had an HSL-based tool; see 'Photoshop hue/saturation' in the GUIdebook for screenshots.[31][32]
  17. ^Photoshop's documentation explains that, e.g., 'Luminosity: Creates a result color with the hue and saturation of the base color and the luminance of the blend color.'[33]
  18. ^The Ohta et al. model has parameters I1 = (R + G + B)/3, I2 = (RB)/2, I3 = (2GRB)/4. I1 is the same as our I, and I2 and I3 are similar to our β and α, respectively, except that (a) where α points in the direction of R in the 'chromaticity plane', I3 points in the direction of G, and (b) the parameters have a different linear scaling which avoids the 3 of our β.
  19. ^Most of the disadvantages below are listed in Poynton (1997), though as mere statements, without examples.
  20. ^Some points in this cylinder fall out of gamut.

References[edit]

  1. ^FR patent 841335, Valensi, Georges, 'Procédé de télévision en couleurs', published 1939-05-17, issued 1939-02-06
  2. ^US patent 2375966, Valensi, Georges, 'System of television in colors', published 1945-05-15
  3. ^ abLevkowitz and Herman (1993)
  4. ^Wilhelm Ostwald (1916). Die Farbenfibel. Leipzig.
  5. ^Wilhelm Ostwald (1918). Die Harmonie der Farben. Leipzig.
  6. ^US patent 4694286, Bergstedt, Gar A., 'Apparatus and method for modifying displayed color images', published 1987-09-15, assigned to Tektronix, Inc
  7. ^Toby Berk; Arie Kaufman; Lee Brownston (August 1982). 'A human factors study of color notation systems for computer graphics'. Communications of the ACM. 25 (8): 547–550. doi:10.1145/358589.358606.
  8. ^Michael W. Schwarz; William B. Cowan; John C. Beatty (April 1987). 'An experimental comparison of RGB, YIQ, LAB, HSV, and opponent color models'. ACM Transactions on Graphics. 6 (2): 123–158. doi:10.1145/31336.31338.
  9. ^Sarah A. Douglas; Arthur E. Kirkpatrick (April 1999). 'Model and representation: the effect of visual feedback on human performance in a color picker interface'. ACM Transactions on Graphics. 18 (2): 96–127. doi:10.1145/318009.318011.
  10. ^ abcdSmith (1978)
  11. ^ abcdJoblove and Greenberg (1978)
  12. ^Maureen C. Stone (August 2001). 'A Survey of Color for Computer Graphics'. Course at SIGGRAPH 2001.
  13. ^Ware Myers (July 1979). 'Interactive Computer Graphics: Flying High-Part I'. Computer. 12 (7): 8–17. doi:10.1109/MC.1979.1658808.
  14. ^N. Magnetat-Thalmann; N. Chourot; D. Thalmann (March 1984). 'Colour Gradation, Shading and Texture Using a Limited Terminal'. Computer Graphics Forum. 3: 83–90. doi:10.1111/j.1467-8659.1984.tb00092.x.
  15. ^Computer Graphics Staff (August 1979). 'Status Report of the Graphics Standards Planning Committee'. ACM SIGGRAPH Computer Graphics. 13 (3): 1–10. doi:10.1145/988497.988498.
  16. ^ abcdefghFairchild (2005), pp. 83–93
  17. ^Kuehni (2003)
  18. ^Standard Terminology of Appearance E284. ASTM. 2009.
  19. ^International Lighting Vocabulary (4th ed.). CIE and IEC. 1987. ISBN978-3-900734-07-7.
  20. ^Poynton (1997)
  21. ^Sharma, G. (2003). Digital Color Imaging Handbook. Boca Raton, FL: CRC Press. ISBN978-0-8493-0900-7.
  22. ^Hanbury and Serra (2002)
  23. ^ abHanbury (2008)
  24. ^Patrick Lambert; Thierry Carron (1999). 'Symbolic fusion of luminance-hue-chroma features for region segmentation'. Pattern Recognition. 32 (11): 1857. doi:10.1016/S0031-3203(99)00010-2.
  25. ^Rafael C. Gonzalez and Richard Eugene Woods (2008). Digital Image Processing, 3rd ed. Upper Saddle River, NJ: Prentice Hall. ISBN0-13-168728-X. pp. 407–413.
  26. ^Poynton (1997). 'What weighting of red, green and blue corresponds to brightness?'
  27. ^Bruce Lindbloom (2001-09-25). http://lists.apple.com/archives/colorsync-users/2001/Sep/msg00488.html 'Re: Luminosity channel..'.
  28. ^ abcdCheng et al. (2001)
  29. ^Tantek Çelik, Chris Lilley, and L. David Baron (July 2008). 'CSS3 Color Module Level 3'.
  30. ^'Working with color ramps'. Environmental Systems Research Institute. January 2008. Retrieved August 30, 2017.
  31. ^Bradley, John (1994). 'The HSV Modification Tools'. John's World of XV and Other Cool Stuff.
  32. ^Sinkel, Kiril (January 2010). 'User Guide for Picture Window and Picture Window Pro Digital Light & Color'(PDF). Archived from the original(PDF) on 2014-05-12.
  33. ^'Blending Modes'. Photoshop User Guide. Adobe Systems Incorporated. February 15, 2017.
  34. ^John Kender (1976). 'Saturation, hue and normalized color'. Carnegie Mellon University, Computer Science Dept. Pittsburgh, PA.
  35. ^Yu-Ichi Ohta; Takeo Kanade; Toshiyuki Sakai (1980). 'Color information for region segmentation'. Computer Graphics and Image Processing. 13 (3): 222. doi:10.1016/0146-664X(80)90047-7.
  36. ^Ffrank Perez; Christof Koch (1994). 'Toward color image segmentation in analog VLSI: Algorithm and hardware'(PDF). International Journal of Computer Vision. 12: 17–42. doi:10.1007/BF01420983.
  37. ^Brewer, Cynthia A. (1999). 'Color Use Guidelines for Data Representation'. Proceedings of the Section on Statistical Graphics. Alexandria, VA: American Statistical Association. pp. 55–60.
  38. ^Fisher, Nicholas (1996). Statistical Analysis of Circular Data. Cambridge, England: Cambridge University Press.
  39. ^Hanbury, Allan (2003). Circular Statistics Applied to Colour Images. 8th Computer Vision Winter Workshop. CiteSeerX10.1.1.4.1381.
  40. ^Poynton (1997). 'What are HSB and HLS?'

Bibliography[edit]

  • Agoston, Max K. (2005). Computer Graphics and Geometric Modeling: Implementation and Algorithms. London: Springer. pp. 300–306. ISBN978-1-85233-818-3. Agoston's book contains a description of HSV and HSL, and algorithms in pseudocode for converting to each from RGB, and back again.
  • Cheng, Heng-Da; Jiang, Xihua; Sun, Angela; Wang, Jingli (2001). 'Color image segmentation: Advances and prospects'. Pattern Recognition. 34 (12): 2259. CiteSeerX10.1.1.119.2886. doi:10.1016/S0031-3203(00)00149-7. This computer vision literature review briefly summarizes research in color image segmentation, including that using HSV and HSI representations.
  • Fairchild, Mark D. (2005). Color Appearance Models (2nd ed.). Addison-Wesley. This book doesn't discuss HSL or HSV specifically, but is one of the most readable and precise resources about current color science.
  • Foley, J. D.; et al. (1995). Computer Graphics: Principles and Practice (2nd ed.). Redwood City, CA: Addison-Wesley. ISBN978-0-201-84840-3. The standard computer graphics textbook of the 1990s, this tome has a chapter full of algorithms for converting between color models, in C.
  • Hanbury, Allan; Serra, Jean (December 2002). A 3D-polar Coordinate Colour Representation Suitable for Image Analysis. Pattern Recognition and Image Processing Group Technical Report 77. Vienna, Austria: Vienna University of Technology.
  • Hanbury, Allan (2008). 'Constructing cylindrical coordinate colour spaces'(PDF). Pattern Recognition Letters. 29 (4): 494–500. CiteSeerX10.1.1.211.6425. doi:10.1016/j.patrec.2007.11.002.
  • Joblove, George H.; Greenberg, Donald (August 1978). 'Color spaces for computer graphics'(PDF). Computer Graphics. 12 (3): 20–25. doi:10.1145/965139.807362. Joblove and Greenberg's paper was the first describing the HSL model, which it compares to HSV.
  • Kuehni, Rolf G. (2003). Color Space and Its Divisions: Color Order from Antiquity to the present. New York: Wiley. ISBN978-0-471-32670-0. This book only briefly mentions HSL and HSV, but is a comprehensive description of color order systems through history.
  • Levkowitz, Haim; Herman, Gabor T. (1993). 'GLHS: A Generalized Lightness, Hue and Saturation Color Model'. CVGIP: Graphical Models and Image Processing. 55 (4): 271–285. doi:10.1006/cgip.1993.1019. This paper explains how both HSL and HSV, as well as other similar models, can be thought of as specific variants of a more general 'GLHS' model. Levkowitz and Herman provide pseudocode for converting from RGB to GLHS and back.
  • MacEvoy, Bruce (January 2010). 'Color Vision'. handprint.com.. Especially the sections about 'Modern Color Models' and 'Modern Color Theory'. MacEvoy's extensive site about color science and paint mixing is one of the best resources on the web. On this page, he explains the color-making attributes, and the general goals and history of color order systems—including HSL and HSV—and their practical relevance to painters.
  • Poynton, Charles (1997). 'Frequently Asked Questions About Color'. poynton.com. This self-published frequently asked questions page, by digital video expert Charles Poynton, explains, among other things, why in his opinion these models 'are useless for the specification of accurate color', and should be abandoned in favor of more psychometrically relevant models.
  • Poynton, Charles (2008). 'YUV and luminance considered harmful'. poynton.com. Retrieved August 30, 2017.
  • Smith, Alvy Ray (August 1978). 'Color gamut transform pairs'. Computer Graphics. 12 (3): 12–19. doi:10.1145/965139.807361. This is the original paper describing the 'hexcone' model, HSV. Smith was a researcher at NYIT's Computer Graphics Lab. He describes HSV's use in an early digital painting program.

External links[edit]

  • HSV Colors by Hector Zenil, The Wolfram Demonstrations Project.
  • HSV to RGB by CodeBeautify.
Retrieved from 'https://en.wikipedia.org/w/index.php?title=HSL_and_HSV&oldid=917313491'