diff options
author | Paweł Redman <pawel.redman@gmail.com> | 2020-06-23 20:08:29 +0200 |
---|---|---|
committer | Paweł Redman <pawel.redman@gmail.com> | 2020-06-23 20:08:29 +0200 |
commit | c0b52c1c841957b27e2dd82a11ecb3b4ff8db265 (patch) | |
tree | da07444182cf7caf88e65fb940f9315349ac03f4 /test_example.py | |
parent | 33278ad88f8290054aa2b421182019b9167f50ff (diff) |
Update the tests again and remove some useless ones.
Diffstat (limited to 'test_example.py')
-rw-r--r-- | test_example.py | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/test_example.py b/test_example.py deleted file mode 100644 index a4104b1..0000000 --- a/test_example.py +++ /dev/null @@ -1,28 +0,0 @@ -import numpy as np -from colour import * -from colour.models import eotf_inverse_sRGB -from colour.difference import delta_E_CIE1976 -from colour.recovery import XYZ_to_sd_Jakob2019 -from gsoc_common import model_sd, D65, D65_xy, plot_comparison - -if __name__ == "__main__": - # These numbers are taken from Jakob and Hanika's Jupyter notebook. - RGB_ref = np.array([0.79264853, 0.4, 0.63703843]) # *linear* sRGB - cc_ref = np.array([ 18.70184886, -13.19804478, 2.12180137]) - - XYZ = sRGB_to_XYZ(eotf_inverse_sRGB(RGB_ref), D65_xy) - Lab = XYZ_to_Lab(XYZ, D65_xy) - print("Target: X=%g, Y=%g, Z=%g, L=%g, a=%g, b=%g" % (*XYZ, *Lab)) - - reference_sd = model_sd(cc_ref) - reference_XYZ = sd_to_XYZ(reference_sd, illuminant=D65) / 100 - reference_Lab = XYZ_to_Lab(reference_XYZ, D65_xy) - - found_sd, error = XYZ_to_sd_Jakob2019(XYZ, return_error=True) - found_XYZ = sd_to_XYZ(found_sd, illuminant=D65) / 100 - found_Lab = XYZ_to_Lab(found_XYZ, D65_xy) - - print("Our results differ from the reference by ΔE = %g" \ - % delta_E_CIE1976(reference_Lab, found_Lab)) - - plot_comparison(XYZ, found_sd, "Reference", error, D65) |