-
-
Notifications
You must be signed in to change notification settings - Fork 258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG]: Problems converting "sRGB" to "Munsell Renotation System". #1173
Comments
The 5 principal and 5 intermediate hues form 10 arcs on the hue circle. The arcs do not intersect (except at the endpoints) and cover the hue circle. Each arc is parameterized from 0 to 10. Hues 10R and 0YR are endpoints of adjacent arcs and denote exactly the same hue. The Munsell system prefers the former notation. The 4'th number 8 in the assertion is the Hue Index of intermediate hue RP. I claim that XYZ should really be chromatically adapted from Illuminant D65 (the sRGB standard) to Illuminant C (with which the Munsell system was designed). So there should be another conversion (a chromatic adaptation transform) between sRGB_to_XYZ() and XYZ_to_xyY(). As a test, when R=G=B, then xy should be about (0.3101,0.3163), and not (0.3127,0.3290). I do not know anything about the apparent requirement that Chroma is in [2,50]. |
I am having the same problems even using the Illuminant C mentioned by glenndavis52, my code is the following:
By introducing as sRGB the following array: array([ 0.5, 0.5, 0.5]) (Trying to achieve the testing of R=G=B) I get the same error AssertionError: "array([ 5.42874897e+00, 5.23531097e+00, 1.08571452e-03, |
@notevenstickmen I've been looking at it (https://colour.readthedocs.io/en/develop/_modules/colour/notation/munsell.html) and it seems that our error is comming from the fact that on the colour.xyY_to_munsell_colour() step, the library internally converts xyY to munsell specification and then munsell specification to munsell colour: ` def xyY_to_munsell_colour(
` If we see the function munsell_specification_to_munsell_colour in detail we will find where the error is popping: ` def munsell_specification_to_munsell_colour(
` Specifically the error is produced here: ` chroma = round(chroma, chroma_decimals) ` But I will need further assistance with why that is happening when going from sRGB to Munsell colour, some help with it wil be much appreciated. I am using the colour.CCS_ILLUMINANTS["CIE 1931 2 Degree Standard Observer"]["C"] illuminant. There was a ColourWarning regarding ColourUsageWarning: "array([ 0.37326798, 0.37285041, 0.09701717])" is not within "MacAdam" limits for illuminant "C"! For the moment what I am doing is the following modification since it solves the problem of a Chroma under 2 e.g: Chroma = 1.8, but I would like to have a better solution that requires less original colours modification: `
` |
Hello, This is a side effect of using the The consequence is a loss of precision and the CIE xyY value becomes For the time being you could to the sRGB conversion as follows because BT.709 uses a computed matrix and will not suffer from precision issues:
|
The |
Question
I'm having problems converting some colours from sRGB to Munsell. I'm no expert in this field so can well believe I'm doing something daft but I don't know what.
I have a spreadsheet (2547 rows) of the main Munsell colours with their sRGB equivalents (I think this came via Paul Centore's work; the numbers check back to this anyway). I've written routine to convert sRGB to Munsell & have been using this spreadsheet to check my results.
Code:
import colour
import numpy as np
rgb = np.array([141,116,121])
XYZ = colour.sRGB_to_XYZ(rgb / 255)
xyY = colour.XYZ_to_xyY(XYZ)
munsell = colour.xyY_to_munsell_colour(xyY, chroma_decimals=1)
Issues:
I have about 55 Assertation errors e.g.
Most of the colours here seem to be relatively low value & chroma but not all
e.g. 02.5RP-9-02 RGB(241,222,239)
AssertionError: ""array([ 3.08954081, 9.02276054, 1.84797444, 8. ])"" specification chroma must be normalised to domain [2, 50]!
The 4th argument looks v strange to me & all cases have this format i.e. n.spaces.
I'm getting quite a lot of hue discrepances in those areas where one hue family changes to another.
e.g.
10.0R -7-08 RGB( 242,150,128) my result: 0.1YR 7.0/8.0
10.0R -7-10 RGB( 254,144,114) my result: 0.1YR 7.0/9.9
10.0R -7-12 RGB( 255,136,97) my result: 0.6YR 6.8/11.0
I most cases, the sub-hue group in my result is < 1 rather than 10.0.
Can anyone advise me?
The text was updated successfully, but these errors were encountered: