Color transformations

Color can be described by its red (R), green (G) and blue (B) coordinates (the well-known RGB system), or by some its linear transformation as XYZ, CMY, YUV, IQ, among others. The CIE adopted systems CIELAB and CIELUV, in which, to a good approximation, equal changes in the coordinates result in equal changes in perception of the color. Nevertheless, sometimes it is useful to describe the colors in an image by some type of cylindrical-like coordinate system, it means by its hue, saturation and some value representing brightness. If the RGB coordinates are in the interval from 0 to 1, each color can be represented by the point in the cube in the RGB space. Let us imagine the attitude of the cube, where the body diagonal linking ”black” vertex and ”white” vertex is vertical. Then the height of each point in the cube corresponds to the brightness of the color, the angle or azimuth corresponds to the hue and the relative distance from the vertical diagonal corresponds to the saturation of the color.

The present color models have some disadvantages in practical use. E.g. we convert an image in some image processing application into some brightness-hue-saturation model and we would like to work with individual components (coordinates) as with separate images. There is desirable regarding to the back conversion to have all combinations of the values. It means we need such model, where the range of values of saturation is identical for all hues. From this point of view, the GLHS color model [2] is probably the best from the current ones, particularly for wmin = wmid = wmax = 1/3. The good model should satisfy some demands as:

  1. The brightness should be a linear combination of all three RGB components. At least, it must be continuous growing function of all of them.
  2. The hue differences between the basic colors (red, green and blue) should be 120 and similarly between the complement colors (yellow, purple and cyan). The hue difference between a basic color and an adjacent complement one (e.g. red and yellow) should be 60.
  3. The saturation should be 1 for the colors on the surface of the RGB color cube, it means in case of one of the RGB components is 0 or 1 except black and white vertices and it is 0 in case of R=G=B. 

In our opinion, the best brightness, hue and saturation system consists of the brightness as linear combination of the RGB values, the hue as actual angle in the color cube and saturation as relative distance from the body diagonal to the surface of the color cube. Such a system, called YHS, is presented in [1]. It satisfies all three demands and makes easier some color manipulations.


Original photograph

Brightness Y

Hue H

Saturation S

Hue with maximum saturation

Optimized histogram in RGB

Optimized histogram in YHS

The original photograph of Klínovec mountain in Bohemia was decomposed into brightness, hue and saturation by YHS model. The image "hue with maximum saturation" shows colors preserving original hue with maximum saturation. Where the original saturation was zero, the hue is not defined and white color is used. Then, the histogram was optimized in RGB coordinates, you can see the hue is distorted. When the histogram was optimized in YHS coordinates, the visibility of the foreground was enhanced without distortion of colors.

Contact person: Tomáš Suk


[1] Suk Tomáš, Šimberová Stanislava: New YHS color coordinate system and its spplication in remote sensing, Proceedings of the 1st Pattern Recognition for Remote Sensing Workshop, p. 6-9, Eds: Petrou M., BMVA Press, (Surrey 2000), PRRS 2000 /1./, (Andorra La Vella, AD, 01.09.2000), Download PDF

Relevant publications by other authors:
[2] Levkowitz, H. and G. T. Herman "GLHS: A Generalized Lightness, Hue, and Saturation Color Model." Computer Vision, Graphics, and Image Processing: Graphical Models and Image Processing, Vol. 55, 271-285, 1993.