import numpy as np from colour import * from jakob_hanika import jakob_hanika, model_sd from test_colorchecker import plot_comparison illuminant = "D65" ill_xy = ILLUMINANTS["CIE 1931 2 Degree Standard Observer"][illuminant] ill_sd = SpectralDistribution(ILLUMINANT_SDS[illuminant]) # A set of inputs that make the Nelder-Mead solver work really hard. # This might not be interesting in future versions of jakob_hanika.py, once # the solver is more reliable. Make sure you've checked out the latest commit # that updates *this* file. if __name__ == "__main__": XYZ = np.array([0.00263241, 0.00174905, 0.00092602]) ccp0 = np.array([5.11263599, -2.65344447, -2.37301856]) ccp, error = jakob_hanika(XYZ, ill_sd, ill_xy, ccp0) if error > 0.1: plot_comparison(XYZ, model_sd(ccp), "Target", error, ill_sd)