Created
September 25, 2014 08:17
-
-
Save KelSolaar/bbf6eda04d5195781052 to your computer and use it in GitHub Desktop.
Colour - OECF - Check
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import colour | |
for c in sorted(colour.RGB_COLOURSPACES.values()): | |
samples = np.linspace(0, 1, 1000) | |
samples_tf = [c.transfer_function(sample) for sample in samples] | |
samples_itf = [c.inverse_transfer_function(sample) for sample in samples_tf] | |
try: | |
np.testing.assert_almost_equal(samples, samples_itf, decimal=4) | |
except: | |
print('Issue with "{0}"'.format(c.name)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment