• Please use real names.

    Greetings to all who have registered to OPF and those guests taking a look around. Please use real names. Registrations with fictitious names will not be processed. REAL NAMES ONLY will be processed

    Firstname Lastname

    Register

    We are a courteous and supportive community. No need to hide behind an alia. If you have a genuine need for privacy/secrecy then let me know!
  • Welcome to the new site. Here's a thread about the update where you can post your feedback, ask questions or spot those nasty bugs!

HSV and HSL and the "hexcones" - the sordid truth

Doug Kerr

Well-known member
The HSV (sometimes called HSB) and HSL color spaces describe a color in terms of three coordinates that represent hue, something like saturation, and something like luminance. Thus, they are attractive at the human interface (for "picking" colors for drawing, etc.).

But unlike a color space that works in true hue, saturation, and luminance, the definitions of the coordinates here admit of simplified calculations in translating between these spaces and the RGB space in which the colors are usually actually held in computer memory, a substantial advantage at the time when these spaces were introduced (early in the era of computer graphics).

We often read that "[the gamut of] the HSV color space is [plots as] a cone (or a hexcone, a figure whose proper name is hexagonal pyramid)".

Similarly, we often read that "[the gamut of] the HSL color space is [plots as] a bi-cone (or a bi-hexcone)".

But what does that mean? The HSV gamut (which is identical to the RGB gamut) plots in the HSV color space as a (circular) cylinder. The HSL gamut (which is also identical to the RGB gamut) plots in the HSL color space as a (circular) cylinder. This (single) gamut plots as a cube in the RGB color space. In no color space we encounter in normal theoretical or practical colorimetry does this gamut plot as a hexcone or bi-hexcone. So what is going on here?

Well, it turns out that this gamut does plot as a hexcone or a bi-hexcone in two different (and peculiar) color spaces we never encounter in normal theoretical or practical colorimetry. What is the significance of these two spaces? Well, they make the RGB/HSV/HSL gamut plot as a hexcone and a bi-hexcone, respectively, that's what.

These color spaces have one coordinate that is the "lightness" coordinate of the color space of interest (V for HSV, L for HSL), but the other coordinates are not coordinates of the color space. Rather, they work in a plane defined by "rotation of the axes" from the coordinate system of the RGB color space. So these are in a sense "hybrid color spaces" (as if, for some reason, we decided to do something in the RGL* color space, or the xyZ color space, both of which I just now "invented"). (For "hybrid" you may wish to read "bastard".)

What does that gambit do for humanity? Well, authors often draw upon these portrayals (without even stating the color space in which they emerge) to illustrate certain "facts" about this gamut, or maybe about the HSV or HSL color spaces themselves. These facts are rarely clearly articulated, and if we can see through the fog and discern what the author seems to be trying to say, we often find that it is not exactly true, or not true at all, or is in fact not illustrated exactly, or at all, by the hexcone or bi-hexcone portrayal.

I will shortly be publishing an article in which this situation is explored more thoroughly, with extensive illustrations and supporting background.
 

Jack_Flesher

New member
Doug:

A small correction and perhaps a very important distinction: HSL or HSB (like Lab) is a color MODEL and not a colorSPACE.

As I understand it, the term colorspace is used to define the limits of color in an RGB coordinate system. I would think that as a color model of total human vision, HSL can be plotted according to the precept of that model; a model that does not have any shared components of a conventional RGB colorspace model. Apples and oranges so to speak... It appears to me (and obviously others) that the bi-cone representation fits this stated HSL model quite accurately. Where is the controversy?


Cheers,
 

Doug Kerr

Well-known member
Hi, Jack,

Doug:

A small correction and perhaps a very important distinction: HSL or HSB (like Lab) is a color MODEL and not a colorSPACE.

Quite so, and I took the wrong shortcut in this "report". Thanks for pointing that out.

But there are in fact HSL color spaces, such as the HSL transform of the sRGB color space or the the HSL transform of the Adobe RGB color space. In my editor, setting an HSL triplet implies a particular color (in the CIE XYZ or xyY sense) owing to the fact that this HSL color space is the transform of a specific RGB color space, namely sRGB. So that setting works in a (particular) HSL color space.

As I understand it, the term colorspace is used to define the limits of color in an RGB coordinate system.

The term color space in traditional scientific terms can mean the limits of color available in any particular color model or a particularization of a color model. It is not limited to an RGB coordinate system.

But the use of color space we most often find today (as, "the Adobe RGB color space", or the "YCbCr color space") implies:

1. A particular color model (that is, a particular conceptual coordinate system) for representing a color. (For the Adobe RGB color space, the model is RGB; for the YCbCr color space it is YCbCr , as there is no "family" YCbCr model.)

2. A precise definition of how the coordinates are to be determined (including scale, range, any nonlinear transformation, etc.).

3. An implicit or explicit gamut, which means the set of all colors that can be represented. (It is the color space [meaning 1] of the color space [meaning 2].) It may be limited by:

a. the limits of human perception with regard to chromaticity (you and I have some disagreement about luminance here, so I'll just slow roll that for now)

and

b. the inherent numerical limits of the coordinate scales.

(It is only the latter set of constraints that is color-space dependent.)

I would think that as a color model of total human vision, HSL can be plotted according to the precept of that model; a model that does not have any shared components of a conventional RGB colorspace model.

Absolutely. We can plot colors in terms of the HSL H, S, and L values, (that is in the HSL coordinate system).

In that case, for the point representing some color:

1. The "height" of the point represents the L value of the color. (This indicates something like relative luminance, but not exactly.)

2. The angle of the vector to the point with respect to some reference direction (corresponding to the hue "red") represents the H value of the color. (This indicates hue.)

3. The radial distance form the L axis to the point represents the S value of the color. (This indicates something like saturation, but not exactly.)

This is perfectly sensible.

When we do this, the entire available gamut of the color model (or the gamut of the color space if the HSL system is derived from a particular RGB color space) is a circular cylinder (certainly not a "bi-hexcone').

Apples and oranges so to speak... It appears to me (and obviously others) that the bi-cone representation fits this stated HSL model quite accurately. Where is the controversy?

Here's the problem. Suppose I have in front of me an actual wood model of the "bi-hexcone", which has been introduced in the context of the HSL model. For some point in it (presumably representing some color), what property is represented by the following:

1. The "height" of the point. Answer: the value L (under the HSL model) for the color represented by the point. [Note that, if anyone asks, this does not have a consistent relationship to the relative luminance of the color.]

2. The angle of the vector to the point with respect to some reference direction. Answer: the value H (under the HSL model) for the color represented by the point. [Note that, if anyone asks, this has a direct correspondence to the hue of the color.]

3. The radial distance from the "L" axis to the point. (Your turn to answer now!)

Hints: It is not the value S under the HSL color model. It is not the saturation of the color (under any of the conventional definitions) nor is it related in a fixed way to saturation (alone).

(I will give the answer at the bottom - don't peek, now!)

Now if you can answer this conundrum, and if those who talk about the bi-hexcone can reveal it (and would do so when they speak about the bi-hexcone "representation", then there is no problem.

But if not, then the hexcone metaphor is not a graphical representation of anything we can grasp.

Now, the answer:

The radius from the L axis to the point in the hexcone that represents a particular color is:

r = sqrt(((2R-G-B)^2 + 3*(G-R)^2)/6)

where R, G, and B are the coordinates of the color under the RGB model.

This does not correlate (even approximately) with any property we recognize as significant in human color perception, nor any coordinate of any color model we encounter in normal colorimetric work (including the HSL model itself).

So to say that the "bi-hexcone" representation "fits the HSL model quite accurately" is a bit of wishful thinking.

That would be true if the coordinates of the hexcone were H, S, and L. But then the gamut would be a cylinder, not a hexcone.

Best regards,

Doug
 

Jack_Flesher

New member
You seem stuck in having to determine HSL values in RGB terms -- I don't see why it's even a consideration? I have already stated the HSL model using those definitions, and am not using ANY RGB transform coordinates you keep referring to in the definition of Hue; Hue can and does exist independent of any system of RGB values. (Yes, a computer needs coordinate values to define a point on a Hue radian in it's binary world, but I as a human being don't -- I can understand and pre-visualize multi-dimensional concepts.)

I can easily visualize an infinite number of S points along a linear Hue radian with minimum value 0 and maximum value 1. I can even envision an infinite number of Hue radians existing on the area of a circle with beginning value 0 and ending value 360. So visualized, I add an L axis to generate my 3D model... Doing so, one gets to a 3d form as a rough bi-cone or bi-conical spheroid when considering only H S and L in the model (no RGB transform coordinates please). I say rough, because admittedly maximum S values in human vision (represented by the surface of the HSL spheroid) may vary irregularly with H and L changes, and thus form an irregular surface (could be smooth too, I don't know.) So the 3-D model is clearly an oblate, irregular spheroid in the worst case, complete with white point on top and black point on bottom, and not a cylinder with area at the lowest and highest S values.

That's how I "see" it anyway :)

Cheers,
 

Doug Kerr

Well-known member
Hi, Jack,

You seem stuck in having to determine HSL values in RGB terms -- it simply isn't necessary.

I may not have said this, but I mean the HSL color model as defined in numerous documents. It is defined as a transform of the RGB coordinates of the color to be represented.

I have already defined the HSL model and using those definitions, NOT the RGB transform coordinates you keep referring to.

Do you mean you are not speaking of the HSL model as defined by these various documents but some other model whose coordinates you also call called "H, S, and L"? I guess I missed that.

Please remind me what properties your H, S, and L represent.

As such, you get a a rough bi-cone.

Well, I can't say "I get it" or "I don't get it" not knowing what H, S, and L represent in your color model. (I'm sorry if you said and I missed it.)

I say rough, because admittedly maximum S values in human vision may vary irregularly as H and L change and thus form an irregular surface. However, the 3-D model is clearly an oblate, irregular spheroid in the worst case (complete with white point on top and black point on bottom), and not a cylinder :)

Do you mean as plotted in your HSL coordinates (Just as one would ordinarily think)?

Is S the "radial" coordinate? Is the vertical axis something like luminance?

Then your spheroid suggests that for lower "quasi-luminance" the available range of S is reduced. (If I knew what you use S to represent I could comment on whether that seems reasonable to me or not.)

Is your S by any chance a measure of perceived saturation? What is your definition of how it is quantified? Does it run from 0-1 (0-100%). What kind of chromaticities would qualify as "100% saturation?

In any case here it seems as if part of our problem here is that you are not thinking of the same "HSL" model I am referring to.

Help me out here.

Best regards,

Doug
 

Ray West

New member
Although I'm all for coffee, pencil and paper, but technology should be able to help here.
I have been trying to get some interest going in collaborative software for some time, there is a trial of something here http://thinkature.com/ I think that this or similar could be very useful.

Like most things, it will get some getting used to, but maybe it will get your 'juices flowing', and reduce the 'carbon footprint'

Best wishes,

Ray
 
Top