why use 0.008856 in Lab color space?

6 views (last 30 days)
Yoon ThiriZaw
Yoon ThiriZaw on 26 May 2019
Commented: DGM on 8 Sep 2024
In Lab color space equations, why use 0.008856 as thresholds if we transform RGB to Lab? Lab color space equation are the following:
The conversion formula of RGB image into Lab image is:
X = 0.4124*R + 0.3576*G + 0.1805*B
Y = 0.2126*R + 0.7152*G + 0.8220*B
Z = 0.0193*R + 0.1192*G + 0.9505*B
If X/X_n,Y/Y_n,Z/Z_nare all greater than 0.008856,then
L* = 116∛("Y/" Y_n )- 16
a* = 500 ( ∛("X/" X_n )- ∛("Y/" Y_n ))
b* = 200 (∛("Y/" Y_n )- ∛("Z/" Z_n ))
If X/X_n,Y/Y_n,Z/Z_nare all equal to or less than 0.008856,then
L* = 903.3(Y/Y_n,)
a* = 500 (f(X/X_n,) – f(Y/Y_n))
b* = 200 (f(Y/Y_n) – f(Z/Z_n))
Why let these thresholds 0.008856?
If less than 0.008856, what we get?
And, if greater than 0.008856, what we get?
Please!!!

Answers (2)

John D'Errico
John D'Errico on 8 Sep 2024
Edited: John D'Errico on 8 Sep 2024
Its been a million years since I looked at those equations. But it seems likely to be almost trivial. They chose a point where the linear segment would mesh with the cube-rootic (good name, huh?) segment, so they would be continuous and differentiable. That is, at the point
ybreak = (6/29)^3;
the linear segment has value
f_l0 = 903.3*ybreak
f_l0 = 8.0000
And the slope of that segment so dL/dy is trivially 903.3.
Now compute the same parameters at the lower end point of the nonlinear segment.
f_hi = 116*(6/29)- 16
f_hi = 8
As you see, the L* relation is continuous across the break. What is the slope of the nonlinenar segment at ybreak?
syms Y
vpa(subs(diff(116*Y^(1/3) - 16,Y),Y,ybreak))
ans = 
903.2962962962962962962962962963
And as you should also see, they just chose a point where the two curve segments will be both continuous and differentiable. The choice was actually pretty abitrary, made necessary by the shape of the nonlinear segment at the bottom end. There is nothing really magic about that number in terms of color. Just a choice made so the L* curve would be well behaved.
Edit: Suppose I want to design the transformation into a space I'll call L#a#b#, from XYZ.
We can look at this a different way. We want a curve that has the characteristic shape of
L(Y) = (100+a)*(Y/Y0)^(1/3) - a
over much of the range of Y. It has a cube-root shape in Y/Y0, such that when Y==Y0, so Y/Y0==1, then we get 100 out. The problem is, then Y==0, we would get -a. And we want the curve to pass through 0 at that point. This means we can choose a linear segment that goes from 0 to some break point, I'll call it b.
So at Y/Y0==b, we need the curve to be continuous and differentiable. Assume the linear segment will be of the form
L(Y) = s*(Y/Y0)
It will pass through zero perforce at y==0, and it has a slope of s.
syms a b y Y Y0 s
Llo(y) = s*y % below b
Llo(y) = 
Lhi(y) = (100+a)*(y)^(1/3) - a; % above b
Now we need to choose b and s, such that these two segments are both continuous and differentiable at the point y==b.
sbsol = solve(Llo(b) == Lhi(b), subs(diff(Llo,y) == diff(Lhi,y),y,b),[s,b])
Warning: Possibly spurious solutions.
sbsol = struct with fields:
s: (4*(a + 100)^3)/(27*a^2) b: (27*a^3)/(8*(a + 100)^3)
When a == 16, what do we get?
subs(sbsol.s,a,16)
ans = 
format long g
24389/27
ans =
903.296296296296
subs(sbsol.b,a,16)
ans = 
216/24389
ans =
0.00885645167903563
Do you see the curve shape choice made in the beginning, of (100+a)*(y/y0)^(1/3)-a, must result in that break point, when a==16? a==16 implies exactly that break point at 0.008856... as well as the coefficient 903.296.
  1 Comment
DGM
DGM on 8 Sep 2024
Your edit here gets at what I think the underlying question probably was -- that is, why it needed to be piecewise in the first place.

Sign in to comment.


DGM
DGM on 8 Sep 2024
Edited: DGM on 8 Sep 2024
The L* function is piecewise, and epsilon is the breakpoint location in terms of relative luminance (obviously).
What significance is 0.008856? It's a very official finite decimal approximation of (6/29)^3
vpa((6/29)^3)
ans = 
0.0088564516790356308171716757554635
No really, what's the actual significance? Well, I don't have a copy of the standard from which it's derived, but Bruce conveniently back-calculates the exact value here
Maybe that's a hint as to the immediate mathematical relevance, even if it does not reveal the physical/perceptual relevance.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!