Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Calculate HUE in CIE L*a*b*??

762 views
Skip to first unread message

AE lover

unread,
Jul 3, 2007, 9:07:05 PM7/3/07
to
Hi all,

Assume that the color point in L*a*b* has the value L, a, and b, is it
correct that HUE angle is computed by HUE_angle=arctan(a/b) ?

Thanks

Mike Russell

unread,
Jul 4, 2007, 12:05:00 AM7/4/07
to
"AE lover" <aelo...@gmail.com> wrote in message
news:1183511225.9...@q75g2000hsh.googlegroups.com...

> Hi all,
>
> Assume that the color point in L*a*b* has the value L, a, and b, is it
> correct that HUE angle is computed by HUE_angle=arctan(a/b) ?

Atan2() is approximately equivalent to hue, and the saturation is related to
the length of the vector in the ab plane . When I do this I the atan() of
pure red so it has a hue angle of zero, to match the RGB based HSB
calculation. The other colors - G, B, C, M, and Y are only very roughly the
same as in HSB, within 20 or 30 degrees

The nice thing about this hue angle is that it is a true trigonometric
calculation. It is more stable as brightness changes than the one computed
for HSB, and it does not have the flat spots at the extreme ends of the
hexcone vertices that is characteristic of HSB.
--
Mike Russell - www.curvemeister.com


Dale Kelly

unread,
Jul 4, 2007, 3:14:54 AM7/4/07
to
On Wed, 04 Jul 2007 04:05:00 +0000, Mike Russell wrote:

> the saturation

there is no saturation correlate in CIELAB because there is no associated
chromaticity diagram, you would have to use CIELUV for this


--
Dale http://www.vedantasite.org
see website for real email address

Graeme Gill

unread,
Jul 4, 2007, 7:12:40 AM7/4/07
to
Dale Kelly wrote:
> there is no saturation correlate in CIELAB because there is no associated
> chromaticity diagram, you would have to use CIELUV for this

The "saturation" correlate for both CIELAB and CIELUV is called Chroma,
and is computed in a very similar fashion.

Graeme Gill.

HA HUY THANH

unread,
Jul 4, 2007, 10:17:59 AM7/4/07
to
Hi guys,
I also get confused with the way to compute HUE angles in CIE L*a*b*.
As I understand it, HUE angles range from 0 to 360 degree. If we use
atan to get HUE angle what if the HUE angle is pi/2 or 3pi/2? (tan (pi/
2) and tan (3pi/2) are +00). Do we need to use asin instead so that
we can compute the whole range from 0 to 2pi?

Thanks

Ha huy Thanh

HA HUY THANH

unread,
Jul 4, 2007, 10:24:05 AM7/4/07
to

On Jul 4, 12:05 am, "Mike Russell" <RE-MOVEm...@Curvemeister.comRE-
MOVE> wrote:
> "AE lover" <aelove...@gmail.com> wrote in message

>
> news:1183511225.9...@q75g2000hsh.googlegroups.com...
>
> > Hi all,
>
> > Assume that the color point in L*a*b* has the value L, a, and b, is it
> > correct that HUE angle is computed by HUE_angle=arctan(a/b) ?
>
> Atan2() is approximately equivalent to hue, and the saturation is related to
> the length of the vector in the ab plane . When I do this I the atan() of
> pure red so it has a hue angle of zero, to match the RGB based HSB
> calculation.


Hi Mike, I think to match Hue in the HSB/HSL (HUE angle=0 for pure
RED), in CIE L*a*b*, Hue_angle should be computed by atan(b/a), not
atan(a/b) as the original poster wrote. Am I missing any point?

Thanks

Ha Huy Thanh
> Mike Russell -www.curvemeister.com


Gernot Hoffmann

unread,
Jul 4, 2007, 10:56:41 AM7/4/07
to
HA HUY THANH schrieb:

> Hi guys,
> I also get confused with the way to compute HUE angles in CIE L*a*b*.
> As I understand it, HUE angles range from 0 to 360 degree. If we use
> atan to get HUE angle what if the HUE angle is pi/2 or 3pi/2? (tan (pi/
> 2) and tan (3pi/2) are +00). Do we need to use asin instead so that
> we can compute the whole range from 0 to 2pi?
>
> Thanks
>
> Ha huy Thanh
>
The four-quadrant arcustangent is calculated for inputs x,y:
C, C+: a = atan2(y,x) with the result angle a in the
range -pi to +pi.
PostScript: x y atan with the result (a) on the stack in the
range 0 to 360 (degrees).

If only the (almost) two-quadrant pocket calculator (atan)
should be available, then it is possible to emulate atan2,
like here on p.8:
http://www.fho-emden.de/~hoffmann/euler26112001.pdf
A singularity happens only for abs(x)+abs(y)<eps.
This is the same situation as for atan2(y,x).

Best regards --Gernot Hoffmann

HA HUY THANH

unread,
Jul 4, 2007, 11:31:54 AM7/4/07
to
OK, so the useful thing is the function atan2 which allows us to
compute the angle in the range from -pi to pi.
Thanks.


On Jul 4, 10:56 am, Gernot Hoffmann <hoffm...@fho-emden.de> wrote:
> HA HUY THANHschrieb:> Hi guys,

Gernot Hoffmann

unread,
Jul 4, 2007, 12:18:38 PM7/4/07
to

HA HUY THANH schrieb:

> OK, so the useful thing is the function atan2 which allows us to
> compute the angle in the range from -pi to pi.
> Thanks.

Yes and no.

If we have to find the angle a for z=tan(a), then the only
solution is a=atan(z). This function is defined for
a=-90°+eps to a=+90°-eps.
It's the inverse function of z=tan(a), but without the
ambiguity of a geometrically inverted tangent function.
The ugly truth is, that using a=atan(z) for z=y/x
delivers in 50% of all cases wrong values.
Wrong by projecting the solution into the range as
explained above.
And the calculation fails for x near to zero.

It's an entirely different task to find the angle for the
coordinate pair y,x (or n,d in my doc, numerator and
denominator).

Intel <=286 didn't have atan2 in the floating point unit
or coprocessor. One had to emulate this function.
Since Intel 386, atan2 is established in the FPU.
In fact, atan2 is the solution for a geometrical task,
solved without an explicit division y/x, given the
pair x,y.

About CIELab:
http://www.fho-emden.de/~hoffmann/cielab03022003.pdf

Best regards --Gernot Hoffmann

My apologies, if this post should appear more than once.

Gernot Hoffmann

unread,
Jul 4, 2007, 1:40:42 PM7/4/07
to

HA HUY THANH schrieb:

> Hi Mike, I think to match Hue in the HSB/HSL (HUE angle=0 for pure
> RED), in CIE L*a*b*, Hue_angle should be computed by atan(b/a), not
> atan(a/b) as the original poster wrote. Am I missing any point?
> Thanks
> Ha Huy Thanh

Yes, hue=atan2(b*,a*) is a generic interpretation,
following common CIELab diagrams.
Then, the CIELab hue requires an offset by degrees
so, that Red is at hue=0°, for a comparison with
(ugly) HSB or (much better) HLS.

Best regards --Gernot Hoffmann

Dale Kelly

unread,
Jul 4, 2007, 8:19:57 PM7/4/07
to
On Wed, 04 Jul 2007 21:12:40 +1000, Graeme Gill wrote:

> The "saturation" correlate for both CIELAB and CIELUV is called Chroma,
> and is computed in a very similar fashion.

"chroma" equals saturation in CIELUV, because there is a "chroma"ticity
diagram (u'v') in which the distance in hues is always linear, there is
NO associated "chroma"ticity diagram for CIELAB, there is no (a',b')

Danny Rich

unread,
Jul 6, 2007, 9:29:32 PM7/6/07
to
The situation is a little more complicated than just correlates of chroma.
Chroma and saturation are related percepts but not equivalent constructs.
Chroma is most easily defined - the difference from a neutral or "gray" at
the same the lightness. Thus C* is the distance away from the (a*,b*) =
(0,0) at a given L* value. There is a chroma metric in CIELUV C*uv defined
similarly for (u*,v*) = (0,0) and L*. But, as Dale states, in a
chromaticity diagram there is no percept of "gray" so the distance from the
white point (uo, vo) to chromaticity points (u',v') of the color stimulus
function is defined as the saturation. So, saturation is most often
associated with lights, self-luminous displays and aperture-mode viewing
conditions.

The term does have a long history of being misused and abused but the proper
definition is given above.

Danny

"Dale Kelly" <THIS_IS_A...@vedantasite.org> wrote in message
news:468c392d$1...@newsgate.x-privat.org...

0 new messages