HSLuv

Last updated

In colorimetry, the HSLuvcolor space is a human-friendly alternative to the HSL color space. It was formerly known as "husl". It is a variation of the CIE LCH(uv) color space, where the C (colorfulness) component is replaced by a "Saturation" (S) component representing the colorfulness percentage relative to the maximum sRGB can provide given the L and H values. [1] The value has nothing to do with "saturation" in color theory.

Contents

History

The color spaces used widely for computer display, such as standard Red Green Blue (sRGB) (and the color models built on it like HSL and HSV) are irregular, which means that even though the rectangles have evenly spaced hue values, the corresponding effect is not linear to the human eye. [2]

The CIELUV color space was designed for perceptual uniformity, based on human experiments, and was adopted in 1976 by the International Commission on Illumination (CIE) as a simple-to-compute transformation of the 1931 CIE XYZ color space. CIELUV has been extensively used for applications such as computer graphics which deal with colored lights. Although additive mixtures of different colored lights will fall on a line in CIELUV's uniform chromaticity diagram (dubbed the CIE 1976 UCS), such additive mixtures will not, contrary to popular belief, fall along a line in the CIELUV color space unless the mixtures are constant in lightness. When accessed by polar coordinates, CIELUV becomes functionally similar to the HSL color space, with the problem that its chroma component doesn't fit into a specific range. Even though CIELUV and CIELAB color spaces are based on human perception, they are not intuitive when working in code. [2]

By extending CIELUV with a new "saturation" component, HSLuv now allows spanning all of the available chroma as a percentage. [3] The HSLuv project is one of the more recent attempts at making these color spaces more intuitive. It allows you to use the CIELUV color space in the same dimensions as the HSL color model. Referred to as a human-friendly HSL, the original code was written in the Haxe programming language, but the project is now implemented in most of the popular programming languages, including JavaScript. [2]

Implementation

The reference implementation is written in Haxe and released under the MIT license.

HSLuv has been ported to the following computer languages: C, C#, Elm, Emacs, GLSL, Haskell, Haxe, Go, Java, JavaScript, Lua, Objective-C, Perl, PHP, Python, Ruby, Rust, Sass, and Swift. [4]

See also

Related Research Articles

<span class="mw-page-title-main">Hue</span> Property of a color indicating balance of color perceived by the normal human eye

In color theory, hue is one of the main properties of a color, defined technically in the CIECAM02 model as "the degree to which a stimulus can be described as similar to or different from stimuli that are described as red, orange, yellow, green, blue, violet," within certain theories of color vision.

<span class="mw-page-title-main">Munsell color system</span> Color space

In colorimetry, the Munsell color system is a color space that specifies colors based on three properties of color: hue, chroma, and value (lightness). It was created by Professor Albert H. Munsell in the first decade of the 20th century and adopted by the United States Department of Agriculture (USDA) as the official color system for soil research in the 1930s.

<span class="mw-page-title-main">RGB color spaces</span> Any additive color space based on the RGB color model

An RGB color space is any additive color space based on the RGB color model.

<span class="mw-page-title-main">HSL and HSV</span> Alternative representations of the RGB color model

HSL and HSV 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.

<span class="mw-page-title-main">Chromaticity</span> Specification of color hue and saturation

Chromaticity is an objective specification of the quality of a color regardless of its luminance. Chromaticity consists of two independent parameters, often specified as hue (h) and colorfulness (s), where the latter is alternatively called saturation, chroma, intensity, or excitation purity. This number of parameters follows from trichromacy of vision of most humans, which is assumed by most models in color science.

<span class="mw-page-title-main">CIELAB color space</span> Standard color space with color-opponent values

The CIELAB color space, also referred to as L*a*b*, is a color space defined by the International Commission on Illumination in 1976. It expresses color as three values: L* for perceptual lightness and a* and b* for the four unique colors of human vision: red, green, blue and yellow. CIELAB was intended as a perceptually uniform space, where a given numerical change corresponds to a similar perceived change in color. While the LAB space is not truly perceptually uniform, it nevertheless is useful in industry for detecting small differences in color.

<span class="mw-page-title-main">Dominant wavelength</span> Any monochromatic spectral light that evokes the corresponding perception of hue

In color science, the dominant wavelength is a method of characterizing a color's hue. Along with purity, it makes up one half of the Helmholtz coordinates. A color's dominant wavelength is the wavelength of monochromatic spectral light that evokes an identical perception of hue.

<span class="mw-page-title-main">Colorfulness</span> Perceived intensity of a specific color

Colorfulness, chroma and saturation are attributes of perceived color relating to chromatic intensity. As defined formally by the International Commission on Illumination (CIE) they respectively describe three different aspects of chromatic intensity, but the terms are often used loosely and interchangeably in contexts where these aspects are not clearly distinguished. The precise meanings of the terms vary by what other functions they are dependent on.

<span class="mw-page-title-main">Color wheel</span> Illustrative organization of color hues

A color wheel or color circle is an abstract illustrative organization of color hues around a circle, which shows the relationships between primary colors, secondary colors, tertiary colors etc.

<span class="mw-page-title-main">Spectral color</span> Color evoked by a single wavelength of light in the visible spectrum

A spectral color is a color that is evoked by monochromatic light, i.e. either a single wavelength of light in the visible spectrum, or a relatively narrow band of wavelengths. Every wavelength of visible light is perceived as a spectral color; when viewed as a continuous spectrum, these colors are seen as the familiar rainbow.

Color digital images are made of pixels, and pixels are made of combinations of primary colors represented by a series of code. A channel in this context is the grayscale image of the same size as a color image, made of just one of these primary colors. For instance, an image from a standard digital camera will have a red, green and blue channel. A grayscale image has just one channel.

A color model is an abstract mathematical model describing the way colors can be represented as tuples of numbers, typically as three or four values or color components. When this model is associated with a precise description of how the components are to be interpreted, taking account of visual perception, the resulting set of colors is called "color space."

<span class="mw-page-title-main">Lightness</span> Property of a color

Lightness is a visual perception of the luminance of an object. It is often judged relative to a similarly lit object. In colorimetry and color appearance models, lightness is a prediction of how an illuminated color will appear to a standard observer. While luminance is a linear measurement of light, lightness is a linear prediction of the human perception of that light.

In colorimetry, the CIE 1976L*, u*, v*color space, commonly known by its abbreviation CIELUV, is a color space adopted by the International Commission on Illumination (CIE) in 1976, as a simple-to-compute transformation of the 1931 CIE XYZ color space, but which attempted perceptual uniformity. It is extensively used for applications such as computer graphics which deal with colored lights. Although additive mixtures of different colored lights will fall on a line in CIELUV's uniform chromaticity diagram, such additive mixtures will not, contrary to popular belief, fall along a line in the CIELUV color space unless the mixtures are constant in lightness.

In color science, color difference or color distance is the separation between two colors. This metric allows quantified examination of a notion that formerly could only be described with adjectives. Quantification of these properties is of great importance to those whose work is color-critical. Common definitions make use of the Euclidean distance in a device-independent color space.

<span class="mw-page-title-main">Color space</span> Standard that defines a specific range of colors

A color space is a specific organization of colors. In combination with color profiling supported by various physical devices, it supports reproducible representations of color – whether such representation entails an analog or a digital representation. A color space may be arbitrary, i.e. with physically realized colors assigned to a set of physical color swatches with corresponding assigned color names, or structured with mathematical rigor. A "color space" is a useful conceptual tool for understanding the color capabilities of a particular device or digital file. When trying to reproduce color on another device, color spaces can show whether shadow/highlight detail and color saturation can be retained, and by how much either will be compromised.

This article provides introductory information about the RGB, HSV, and HSL color models from a computer graphics perspective. An introduction to colors is also provided to support the main discussion.

A color appearance model (CAM) is a mathematical model that seeks to describe the perceptual aspects of human color vision, i.e. viewing conditions under which the appearance of a color does not tally with the corresponding physical measurement of the stimulus source.

<span class="mw-page-title-main">HCL color space</span> Color space model

HCL (Hue-Chroma-Luminance) or LCh refers to any of the many cylindrical color space models that are designed to accord with human perception of color with the three parameters. Lch has been adopted by information visualization practitioners to present data without the bias implicit in using varying saturation. They are, in general, designed to have characteristics of both cylindrical translations of the RGB color space, such as HSL and HSV, and the L*a*b* color space. Some conflicting definitions of the terms are:

References

  1. "Using circular color systems". seaborn.pydata.org.
  2. 1 2 3 "Perceptually uniform color spaces". programmingdesignsystems.com.
  3. "Info". www.hsluv.org.
  4. "Implementations". www.hsluv.org.