-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Description
I wanted to plot the xy gamut so I created a meshgrid from 0 to 1,
but colorspacious raises an IndexError for [0, 0, 0.5]:
In [5]: colorspacious.cspace_convert([0.0, 0.0, 0.5], 'xyY1', 'JCh')
IndexError Traceback (most recent call last)
<ipython-input-16-75b580b587d2> in <module>
----> 1 colorspacious.cspace_convert([0.0, 0.0, 0.5], 'xyY1', 'JCh')
~/.local/anaconda3/lib/python3.7/site-packages/colorspacious/conversion.py in cspace_convert(arr, start, end)
230 """
231 converter = cspace_converter(start, end)
--> 232 return converter(arr)
233
234 def check_cspace_convert(source_cspace, target_cspace, gold, **kwargs):
~/.local/anaconda3/lib/python3.7/site-packages/colorspacious/transform_graph.py in __call__(self, x)
579 def __call__(self, x):
580 for transform, kwargs in zip(self._transforms, self._kwargses):
--> 581 x = transform(x, **kwargs)
582 return x
583
~/.local/anaconda3/lib/python3.7/site-packages/colorspacious/conversion.py in _XYZ100_to_CIECAM02(XYZ100, ciecam02_space)
84
85 def _XYZ100_to_CIECAM02(XYZ100, ciecam02_space):
---> 86 return ciecam02_space.XYZ100_to_CIECAM02(XYZ100)
87
88 def _CIECAM02_to_XYZ100(CIECAM02, ciecam02_space):
~/.local/anaconda3/lib/python3.7/site-packages/colorspacious/ciecam02.py in XYZ100_to_CIECAM02(self, XYZ100, on_negative_A)
213 tmp = (hprime - h_i[i]) / e_i[i]
214 H = H_i[i] + ((100 * tmp)
--> 215 / (tmp + (h_i[i + 1] - hprime) / e_i[i + 1]))
216
217 #### Step 7
IndexError: index 5 is out of bounds for axis 0 with size 5
For rather small values, it raises a different, more telling error:
In [6]: colorspacious.cspace_convert([0.0, 0.00001, 0.5], 'xyY1', 'JCh')
NegativeAError: attempted to convert a tristimulus value whose achromatic signal was negative, and on_negative_A="raise"
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels