summaryrefslogtreecommitdiff
path: root/test_what.py
diff options
context:
space:
mode:
Diffstat (limited to 'test_what.py')
-rw-r--r--test_what.py36
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)