Skip to content

Instantly share code, notes, and snippets.

@KelSolaar
Created September 25, 2014 08:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KelSolaar/bbf6eda04d5195781052 to your computer and use it in GitHub Desktop.
Save KelSolaar/bbf6eda04d5195781052 to your computer and use it in GitHub Desktop.
Colour - OECF - Check
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