Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ksmet1977 committed Mar 9, 2023
1 parent 8e20e99 commit dca153e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
5 changes: 3 additions & 2 deletions luxpy/color/cam/ciecam02.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ def run(data, xyzw = _DEFAULT_WHITE_POINT, Yw = None, outin = 'J,aM,bM',
# Calculate degree of chromatic adaptation:
if D is None:
D = F*(1.0-(1.0/3.6)*np.exp((-La-42.0)/92.0))
D = np.atleast_2d(D)

#===================================================================
# WHITE POINT transformations (common to forward and inverse modes):
Expand All @@ -224,7 +225,7 @@ def run(data, xyzw = _DEFAULT_WHITE_POINT, Yw = None, outin = 'J,aM,bM',

#--------------------------------------------
# apply von Kries cat:
rgbwc = ((D*Yw/rgbw) + (1 - D))*rgbw # factor 100 from ciecam02 is replaced with Yw[i] in ciecam16, but see 'note' in Fairchild's "Color Appearance Models" (p291 ni 3ed.)
rgbwc = ((D.T*Yw/rgbw) + (1 - D.T))*rgbw # factor 100 from ciecam02 is replaced with Yw[i] in ciecam16, but see 'note' in Fairchild's "Color Appearance Models" (p291 ni 3ed.)

#--------------------------------------------
# convert from cat02 sensor space to cone sensors (hpe):
Expand Down Expand Up @@ -268,7 +269,7 @@ def run(data, xyzw = _DEFAULT_WHITE_POINT, Yw = None, outin = 'J,aM,bM',

#--------------------------------------------
# apply von Kries cat:
rgbc = ((D*Yw/rgbw)[...,None] + (1 - D))*rgb # factor 100 from ciecam02 is replaced with Yw[i] in ciecam16, but see 'note' in Fairchild's "Color Appearance Models" (p291 ni 3ed.)
rgbc = ((D.T*Yw/rgbw)[...,None] + (1 - D.T))*rgb # factor 100 from ciecam02 is replaced with Yw[i] in ciecam16, but see 'note' in Fairchild's "Color Appearance Models" (p291 ni 3ed.)

#--------------------------------------------
# convert from cat02 sensor space to cone sensors (hpe):
Expand Down
7 changes: 4 additions & 3 deletions luxpy/color/cam/ciecam16.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@ def run(data, xyzw = _DEFAULT_WHITE_POINT, Yw = None, outin = 'J,aM,bM',
# Calculate degree of chromatic adaptation:
if D is None:
D = F*(1.0-(1.0/3.6)*np.exp((-La-42.0)/92.0))

D = np.atleast_2d(D)

#===================================================================
# WHITE POINT transformations (common to forward and inverse modes):

Expand All @@ -201,7 +202,7 @@ def run(data, xyzw = _DEFAULT_WHITE_POINT, Yw = None, outin = 'J,aM,bM',

#--------------------------------------------
# apply von Kries cat:
rgbwc = ((D*Yw/rgbw) + (1 - D))*rgbw # factor 100 from ciecam16 is replaced with Yw[i] in cam16, but see 'note' in Fairchild's "Color Appearance Models" (p291 ni 3ed.)
rgbwc = ((D.T*Yw/rgbw) + (1 - D.T))*rgbw # factor 100 from ciecam16 is replaced with Yw[i] in cam16, but see 'note' in Fairchild's "Color Appearance Models" (p291 ni 3ed.)

#--------------------------------------------
# convert from cat16 sensor space to cone sensors:
Expand Down Expand Up @@ -241,7 +242,7 @@ def run(data, xyzw = _DEFAULT_WHITE_POINT, Yw = None, outin = 'J,aM,bM',

#--------------------------------------------
# apply von Kries cat:
rgbc = ((D*Yw/rgbw)[...,None] + (1 - D))*rgb # factor 100 from ciecam16 is replaced with Yw[i] in cam16, but see 'note' in Fairchild's "Color Appearance Models" (p291 ni 3ed.)
rgbc = ((D.T*Yw/rgbw)[...,None] + (1 - D.T))*rgb # factor 100 from ciecam16 is replaced with Yw[i] in cam16, but see 'note' in Fairchild's "Color Appearance Models" (p291 ni 3ed.)

#--------------------------------------------
# convert from cat16 sensor space to cone sensors:
Expand Down

0 comments on commit dca153e

Please sign in to comment.