Skip to content

Commit

Permalink
Optimized first time chromatic adaptation
Browse files Browse the repository at this point in the history
Optimize a missed call related to chromatic adaptation and remove
unnecessary type import
  • Loading branch information
facelessuser committed Nov 2, 2023
1 parent b9e422b commit f6d0a61
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions coloraide/cat.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from . import algebra as alg
import functools
from .types import Matrix, VectorLike, Vector, Plugin
from typing import Any # noqa: F401

# From CIE 2004 Colorimetry T.3 and T.8
# B from https://en.wikipedia.org/wiki/Standard_illuminant#White_point
Expand Down Expand Up @@ -60,7 +59,7 @@ def calc_adaptation_matrices(
first = alg.dot(m, util.xy_to_xyz(w1), dims=alg.D2_D1)
second = alg.dot(m, util.xy_to_xyz(w2), dims=alg.D2_D1)
m2 = alg.diag(alg.divide(first, second, dims=alg.D1))
adapt = alg.dot(alg.solve(m, m2), m)
adapt = alg.dot(alg.solve(m, m2), m, dims=alg.D2)

return adapt, alg.inv(adapt)

Expand Down

0 comments on commit f6d0a61

Please sign in to comment.