diff options
author | Paweł Redman <pawel.redman@gmail.com> | 2020-06-19 23:42:16 +0200 |
---|---|---|
committer | Paweł Redman <pawel.redman@gmail.com> | 2020-06-19 23:42:16 +0200 |
commit | 77221e174cdab64de60450646de77f849b043062 (patch) | |
tree | 313032eb10ba2aeb2ceda2de8a141d0f8caeb8c4 /test_coverage.py | |
parent | 79d22b12c8c69962090ecc893aedf7195450737c (diff) |
Major cleanup
- The interpolator code is no longer here (but in the Colour fork)
- Refactoring made the code shorter and cleaner
- All tests work properly again
Diffstat (limited to 'test_coverage.py')
-rw-r--r-- | test_coverage.py | 15 |
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 |