-
In the docstring for RGB_to_XYZ, it's noted that values should be in [0,1]: But in example_models.py, the one example of using this function provides a value > 1: This seems inconsistent and caused me some confusion: I wanted to confirm the presumed ranges for RGB values after seeing this example, and so had to do some detection. Perhaps the example should be fixed. |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments
-
Hi @shanest, This is a very good point and something we should improve, so basically there are a few things at play here:
@MichaelMauderer : Any new thoughts about this? |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
I agree that the terminology might be confusing and we have to clarify somewhat. I also remember we agonised about the terminology here quite a bit in the past... I think in the long term it makes a lot of sense to be consistent across the API. But getting there without adding confusion and problems along the way is tricky. These changes can go undetected easily and start so subtly (or not so subtly) break code. Would it a good idea to actually have a parameter that indicates the "domain" of the values going into a function? That would allow us to document the current behaviour through the default value for that parameter, but also shift the default in a future release. The parameter could start At the same time, we could have a flag that enables/disables warnings for out of "normal range" values, making it easier to spot mistakes (and add explanation in cases like this about what's going on) |
Beta Was this translation helpful? Give feedback.
-
Yes absolutely.
I was thinking about it again and it is really hard to settle on what is consistent. As an example, the various Lightness and CIE Lab* functions output Lightness as a percentage, and somebody would be super confused if we were to divide their output by 100. I was looking Bruce Lindbloom calculator by curiosity and he does not really have a solution for this precise problem either: Notice how CIE XYZ, CIE xyY and RGB are expressed as numbers but the others are percentage. He has however Scale checkboxes and this is really what it is about here. I think I remember that this is the term I originally cherry picked for the metadata branch to represent this but we are currently using extent PS: I noticed that the Fairchild (201*) Luminance and Lightness definitions docstrings need update. |
Beta Was this translation helpful? Give feedback.
-
You are right. It would also be problematic to break with common conventions and definitions. Maybe we should try to get an overview of all the different approaches in use right now. |
Beta Was this translation helpful? Give feedback.
-
@MichaelMauderer : There is actually a non-up-to-date spreadsheet here: https://docs.google.com/spreadsheets/d/1lYQgMcwCrToc5A76r2VYkRS5NQtu4BmPviQzzd6p1QM/edit?usp=sharing |
Beta Was this translation helpful? Give feedback.
-
So trying a few things: Original
A
B
C
@MichaelMauderer , @nick-shaw : Any other forms or comments appreciated :) |
Beta Was this translation helpful? Give feedback.
-
We have settled on B. |
Beta Was this translation helpful? Give feedback.
We have settled on B.