Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.