Advertisement
Guest User

Untitled

a guest
Apr 25th, 2015
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. from pprint import pprint
  2.  
  3. from colour import XYZ_to_CIECAM02, CIECAM02_VIEWING_CONDITIONS, sRGB_to_XYZ
  4. from colour.models.deprecated import RGB_to_HSV
  5.  
  6. XYZ = np.array([19.01, 20.00, 21.78])
  7. XYZ_w = np.array([95.05, 100.00, 108.88])
  8. L_A = 318.31
  9. Y_b = 20.0
  10. surround = CIECAM02_VIEWING_CONDITIONS['Average']
  11.  
  12. RGB = np.random.random(3)
  13. RGB = np.array([0.1, 0.4, 1])
  14.  
  15. RGB_g, CIECAM02_H, HSV_H = [], [], []
  16.  
  17. for i in np.linspace(0.2, 2, 10):
  18. RGB_c = RGB ** i
  19. RGB_g.append(RGB_c)
  20. CIECAM02_H.append(XYZ_to_CIECAM02(sRGB_to_XYZ(RGB_c), XYZ_w, L_A, Y_b, surround).H)
  21. HSV_H.append(RGB_to_HSV(RGB_c)[0])
  22.  
  23. pprint(RGB_g)
  24. pprint(CIECAM02_H)
  25. pprint(HSV_H)
  26.  
  27. [array([ 0.63095734, 0.83255321, 1. ]),
  28. array([ 0.39810717, 0.69314484, 1. ]),
  29. array([ 0.25118864, 0.57707996, 1. ]),
  30. array([ 0.15848932, 0.48044977, 1. ]),
  31. array([ 0.1, 0.4, 1. ]),
  32. array([ 0.06309573, 0.33302128, 1. ]),
  33. array([ 0.03981072, 0.27725794, 1. ]),
  34. array([ 0.02511886, 0.23083198, 1. ]),
  35. array([ 0.01584893, 0.19217991, 1. ]),
  36. array([ 0.01, 0.16, 1. ])]
  37. [301.71022473499852,
  38. 305.03754788563873,
  39. 307.66791108080207,
  40. 309.48266207966486,
  41. 310.58957274037681,
  42. 311.17908942211699,
  43. 311.43581764636957,
  44. 311.49370669850163,
  45. 311.45041599570141,
  46. 311.3719308524586]
  47. [0.57562214922566479,
  48. 0.58496948898334489,
  49. 0.59413141546907522,
  50. 0.60290030344435142,
  51. 0.61111111111111105,
  52. 0.61864938990436735,
  53. 0.62545131735579618,
  54. 0.63149774314357232,
  55. 0.63680489319977196,
  56. 0.64141414141414121]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement