summaryrefslogtreecommitdiff
path: root/test_coverage.py
diff options
context:
space:
mode:
Diffstat (limited to 'test_coverage.py')
-rw-r--r--test_coverage.py15
1 files changed, 6 insertions, 9 deletions
diff --git a/test_coverage.py b/test_coverage.py
index e73e015..90e3c79 100644
--- a/test_coverage.py
+++ b/test_coverage.py
@@ -1,14 +1,10 @@
import numpy as np, os, multiprocessing
from colour import *
from colour.models import eotf_inverse_sRGB
-from jakob_hanika import jakob_hanika, model_sd
+from gsoc_common import D65, D65_xy, jakob_hanika, model_sd, plot_comparison
-illuminant = "D65"
-ill_xy = ILLUMINANTS["CIE 1931 2 Degree Standard Observer"][illuminant]
-ill_sd = SpectralDistribution(ILLUMINANT_SDS[illuminant]) # Note: changed in dev (to ILLUMINANT_SD)
-
# Resolution of the discretization cubes
# Both should be 64, but this code is a bit too slow at the moment
CHROMA_STEPS = 8
@@ -19,10 +15,10 @@ LIGHTNESS_STEPS = 8
# Solve for a specific RGB color
def optimize_RGB(linear_RGB, ccp0):
RGB = eotf_inverse_sRGB(linear_RGB)
- target = sRGB_to_XYZ(RGB, ill_xy)
- ccp, error = jakob_hanika(target, ill_sd, ill_xy, ccp0, verbose=False)
+ target = sRGB_to_XYZ(RGB, D65_xy)
+ ccp, error = jakob_hanika(target, D65, D65_xy, ccp0, verbose=False)
if error > 0.1:
- print("WARNING: convergence failed with L=%s, starting from %s" \
+ print("WARNING: convergence failed with L=%s, starting from %s"
% (linear_RGB, ccp0))
return ccp, error
@@ -90,7 +86,8 @@ if __name__ == "__main__":
dirname = "out/R%.3fG%.3fB%.3f" % (*RGB,)
total += 1
- if os.path.exists(dirname) and len(os.listdir(dirname)) == LIGHTNESS_STEPS:
+ if os.path.exists(dirname) and \
+ len(os.listdir(dirname)) == LIGHTNESS_STEPS:
done += 1
continue