[argyllcms] Re: Lab values in BtoA matrix

  • From: Gerhard Fuernkranz <nospam456@xxxxxx>
  • To: argyllcms@xxxxxxxxxxxxx
  • Date: Tue, 25 Sep 2007 21:47:13 +0200

John Weissberg wrote:
> I am a bit confused about the Lab values in the BtoA LUTs. In my case,
> the BtoA LUTs are 33 x 33 x 33 and the abcissa for the points in the
> LUT are like:
> L  a  b
> 0  0  0
> 0  0  1
> 0  0  2
> ...
> 32 32 30
> 32 32 31
> 32 32 32
> As I understand things for this LUT, an a or b value of 0 corresponds
> to -128 and an a or b value of 32 corresponds to 127.
> My calculations then show that a value of 16 for a or b would not
> correspond to 0. Instead 16 corresponds to a value of -0.5.
>   16*255/32-128 = -0.5
> I know this must be incorrect.Can someone please try to explain to me
> what I have missed.

You did not miss anything, but your observation is correct. The ICC
CIELAB encodings are indeed defined in a way that the neutral colors
[a*,b*] = [0,0] do NOT fall exactly on the center axis of the B2A CLUT
grid (unless you're using prelinearization tables which apply an
appropriate offset).

Also notice that the ICC spec defines three different CIELAB encodings:
8-bit, 16-bit (V4), and legacy 16-bit, so you need to distinguish,
depending on the actual LUT type (lut8Type, lut16Type, lutAtoBType,
lutBtoAType) of the considered A2B or B2A table. See pages 11 and 43-44
of the "Specification ICC.1:2004-10 (Profile version". Btw, for
the 16-bit legacy CIELAB encoding (=> lut16Type, corresponding to 16-bit
A2B/B2A tables of V2 profiles), a*=0 or b*=0 is encoded as 0x8000, which
is very close to the center of the 16-bit 0x0000..0xFFFF range (=>
0.5000076). For 8-bit encoding, 0x80 differs more from the center of the
0x00..0xFF range (=> 0.50196), and 16-bit V4 encoding, where a*=0 or
b*=0 is encoded as 0x8080, is equally off from the center as 8-bit encoding.


Other related posts: