From 79d22b12c8c69962090ecc893aedf7195450737c Mon Sep 17 00:00:00 2001 From: Paweł Redman Date: Fri, 19 Jun 2020 22:17:47 +0200 Subject: A quick to see if my Colour fork even works See https://github.com/enneract/colour/tree/feature/jakob2019 --- test_integration.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 test_integration.py diff --git a/test_integration.py b/test_integration.py new file mode 100644 index 0000000..35c19ed --- /dev/null +++ b/test_integration.py @@ -0,0 +1,23 @@ +import numpy as np +from colour import * +from colour.recovery import Jakob2019Interpolator +from colour.plotting import plot_multi_sds + + + +illuminant = "D65" +ill_xy = ILLUMINANTS["CIE 1931 2 Degree Standard Observer"][illuminant] +ill_sd = SpectralDistribution(ILLUMINANT_SDS[illuminant]) + + + +if __name__ == "__main__": + RGB = np.array([0.79264853, 0.4, 0.63703843]) + XYZ = sRGB_to_XYZ(1.055 * RGB ** (1/2.4) - 0.055, ill_xy) + sd = XYZ_to_sd(XYZ, method="Jakob 2019", verbose=True) + + interp = Jakob2019Interpolator() + interp.read_file("data/srgb.coeff") + sdi = interp(RGB) + + plot_multi_sds([sd, sdi]) -- cgit