diff options
author | Paweł Redman <pawel.redman@gmail.com> | 2020-06-26 11:56:21 +0200 |
---|---|---|
committer | Paweł Redman <pawel.redman@gmail.com> | 2020-06-26 11:56:21 +0200 |
commit | 93d0842aae13d14c863298e1903e235ac43500d9 (patch) | |
tree | 67f5b928e96c2a14d0f1517cff43a4eacabc63fd /test_what.py | |
parent | e04cc64a963f3031c0c15277f9b8aed501a8570f (diff) |
Trying to figure out why the solver diverges...
Diffstat (limited to 'test_what.py')
-rw-r--r-- | test_what.py | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/test_what.py b/test_what.py new file mode 100644 index 0000000..92b98e8 --- /dev/null +++ b/test_what.py @@ -0,0 +1,36 @@ +import numpy as np +from colour import * +from colour.difference import delta_E_CIE1976 +from colour.models import RGB_COLOURSPACES +from colour.recovery import RGB_to_sd_Jakob2019, Jakob2019Interpolator +from gsoc_common import * + +colourspace = RGB_COLOURSPACES["sRGB"] + + +if __name__ == "__main__": + RGB = np.array([0.1668, 0.000, 0.0334]) + + + matched_sd, error = RGB_to_sd_Jakob2019( + RGB, + colourspace, + #coefficients_0=(57.94046366, -39.65092867, 2.48839434), + return_error=True, + use_feedback=True, + ) + + print("Error is %g" % error) + + XYZ = RGB_to_XYZ( + RGB, + colourspace.whitepoint, + D65_xy, + colourspace.RGB_to_XYZ_matrix, + ) + + print("Target was %s %s" % (colourspace.name, RGB)) + print("...XYZ = %s" % XYZ) + print("...Lab = %s" % XYZ_to_Lab(XYZ, D65_xy)) + + plot_comparison(XYZ, matched_sd, "target", error, D65) |