Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
RGB to HSV - Roundtrips
import numpy as np
import colour
RGB_i = [0.325683457522574, 0.094356847568351, 0.745367969845698]
RGB_o = np.ones(3)
for i in range(10000):
RGB_o = colour.HSV_to_RGB(colour.RGB_to_HSV(RGB_i))
np.testing.assert_almost_equal(RGB_i, RGB_o, decimal=15)
print(RGB_o)
# [ 0.32568346 0.09435685 0.74536797]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment