summaryrefslogtreecommitdiff
path: root/test_interpolator.py
diff options
context:
space:
mode:
Diffstat (limited to 'test_interpolator.py')
-rw-r--r--test_interpolator.py29
1 files changed, 15 insertions, 14 deletions
diff --git a/test_interpolator.py b/test_interpolator.py
index ab542f3..ba476da 100644
--- a/test_interpolator.py
+++ b/test_interpolator.py
@@ -3,25 +3,26 @@ from colour import *
from colour.difference import delta_E_CIE1976
from colour.models import eotf_inverse_sRGB
from colour.recovery import Jakob2019Interpolator
-from gsoc_common import D65, D65_xy, model_sd, plot_comparison
+from gsoc_common import *
+
# This script tests if the interpolator correctly handles multi-dimensional
# inputs.
if __name__ == "__main__":
- interp = Jakob2019Interpolator()
- interp.from_file("data/srgb.coeff")
+ interp = Jakob2019Interpolator()
+ interp.from_file("data/srgb.coeff")
- RGBs = np.random.random((7, 6, 5, 4, 3))
- ccs = interp.coefficients(RGBs)
+ RGBs = np.random.random((7, 6, 5, 4, 3))
+ ccs = interp.coefficients(RGBs)
- RGB = eotf_inverse_sRGB(RGBs[0, 0, 0, 0, :])
- XYZ = sRGB_to_XYZ(RGB)
- Lab = XYZ_to_Lab(XYZ, D65_xy)
- cc = ccs[0, 0, 0, 0, :]
+ RGB = eotf_inverse_sRGB(RGBs[0, 0, 0, 0, :])
+ XYZ = sRGB_to_XYZ(RGB)
+ Lab = XYZ_to_Lab(XYZ, D65_xy)
+ cc = ccs[0, 0, 0, 0, :]
- matched_sd = model_sd(cc, primed=False)
- matched_XYZ = sd_to_XYZ(matched_sd, illuminant=D65) / 100
- matched_Lab = XYZ_to_Lab(matched_XYZ, D65_xy)
- error = delta_E_CIE1976(Lab, matched_Lab)
+ matched_sd = model_sd(cc, primed=False)
+ matched_XYZ = sd_to_XYZ(matched_sd, illuminant=D65) / 100
+ matched_Lab = XYZ_to_Lab(matched_XYZ, D65_xy)
+ error = delta_E_CIE1976(Lab, matched_Lab)
- plot_comparison(XYZ, matched_sd, "Model", error, D65)
+ plot_comparison(XYZ, matched_sd, "Model", error, D65)