colour-science / colour

Colour Science for Python
https://www.colour-science.org
BSD 3-Clause "New" or "Revised" License
2.14k stars 263 forks source link

Implement support for "Optimal Colour Stimuli" computation. #364

Open KelSolaar opened 6 years ago

KelSolaar commented 6 years ago

We are currently using pre-computed Optimal Colour Stimuli tables from MacAdam (1935) and they are not very precise, only account from Luminance domain [10, 95] with the negative side-effect of labelling a lot of Munsell Real colours outside the MacAdam limits:

import colour

xyY_r = []
for _HVC, xyY in colour.MUNSELL_COLOURS_REAL:
    xyY_r.append(xyY * np.array([1.0, 1.0, 1.0 / 100.0]))
xyY_r = np.array(xyY_r)

iml = colour.is_within_macadam_limits(xyY_r, 'C')
print(len(xyY_r))
print(len(iml[iml == False]))
# 2734
# 829

We should improve this behaviour by implementing an analytical computation for Optimal Colour Stimuli.

References

gutenzwerg commented 3 years ago

I wrote a program to calculate MacAdam-Limits. I presume it is, what was wished in this issue I did already a pull request for this Feature/macadam limits #768

Every single whavelenght shoud be accurate enough. If necessary, it is possible to modify the program to use different cmfs instead of only CIE-31 2° by default. MacAdamLimits

gutenzwerg commented 2 years ago

As far as I see. My function "macadam_limits" is not build in in the actual version. Am I right? I need help in resolving the moand conflicts written at the pull request. It all relates to stuff of rights and features within comment-areas. I have no idea what to write in. Can anyone help me to resolve the conflicts? Otherwise this feature can not be implemented.