L*a*b* normalisation in PI

Mike1485

Well-known member
I have been trying to understand the normalisation of the a and b components of the CIE Lab implementation within PixInsight. For anyone wanting to look at colour spaces in general, I can highly recommend Bruce Lindbloom's site.

I have used sRGB with a D50 reference white. I have also used the true sRGB gamma function, not the 2.2 approximation.

As far as I can tell PI normalises both the a and the b channels using the following equation (subject to possible rounding errors): nv = 0.004639 * v + 0.54287, where v is the a or b component as calculated using the principles set out on Bruce Lindbloom's site, and nv is the normalised value as used in PI (eg in the CIEa and CIEb PixelMath functions).

As far as I can see the actual range of possible values (sRGB/D50) for "a" range from -79.29 to 93.55, and for "b" they range from -112.03 to 93.39.

The normalisation formula implies a normalised range from 0 to 1 would correspond to a range from -117.03 to 98.55. Comparing this to the ranges in the previous paragraph suggests a "buffer" of 5 at each end of the range has been added. My question is whether the PI normalisation is a standard approach, in which case is anyone able to point me to a reference, or is it a PI approach, in which case is this documented somewhere so I can understand better?
 
Hi Mike,

The transformation applied to CIE a*, b* and c* components depends on RGB working space parameters (gamma function, luminance coefficients and chromaticity coordinates). This transformation is linear and ensures that the components will be in the [0,1] range for all possible combinations of R, G and B values, also in [0,1].

The transformation and its inverse transformation are applied by the RGB to/from CIE L*a*b* and RGB to/from CIE L*c*h* conversion functions transparently, so all internal calculations are always performed using the original range of values for each color space; only the externally visible components are normalized to [0,1]. You can check how these functions work with PJSR, for example on Process Console:

j var RGB = new RGBColorSystem j RGB.cieLabToRGB( RGB.rgbToCIELab( 0.2, 0.45, 0.8 ) ) 0.1999999999999995,0.4500000000000001,0.8

This normalization of CIE nonlinear color space components is a distinctive feature of the PixInsight platform. It is nonstandard because it differs from the standard definition of these color spaces and probably no other software uses it, but it does not change the way these color spaces work in practice, as you can verify with tools such as CurvesTransformation for example. The main advantage of this normalization is that it allows us to implement generalized transformations that don't depend on specific RGB working space parameters.
 
Thanks for getting back so promptly with this Juan. I was expecting the answer that the approach is PixInsight specific but good to have that confirmed. Of course the linear normalisation transformation must be specific to the colour space parameters but is it recorded somewhere how the transformation is derived? Thanks.
 
Back
Top