You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Certain values passed into delta_E_CIE1994() cause an exception or nan result.
The cause looks like rounding of intermediate floating point values resulting in a square root of a negative number. For the example inputs in the reproduction section, the argument to sqrt is:
Thank you, this is rather unfortunate the subtraction produces that. I'm wondering if we should not take the absolute value rather than clamping to zero. I will check if the CIE has some recommendations for that.
KelSolaar
changed the title
[BUG]: Exception/nan in delta_E_CIE1994()
[BUG]: *nan* are generated by colour.difference.delta_E_CIE1994 definition.
Oct 13, 2023
Description
Certain values passed into
delta_E_CIE1994()
cause an exception or nan result.The cause looks like rounding of intermediate floating point values resulting in a square root of a negative number. For the example inputs in the reproduction section, the argument to
sqrt
is:A likely fix seems be to enforce a lower bound of 0 on this expression before the sqrt.
Code for Reproduction
Exception Message
Environment Information
The text was updated successfully, but these errors were encountered: