-
Notifications
You must be signed in to change notification settings - Fork 61
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
Lab and Lch values #49
Comments
I don't know why, but I didn't even think about that. The current scaling turns out to be even worse than I thought. This is probably one of those times when it's better to not be so clever. |
|
With the blending additions, I am not sure whether storing the unscaled or scaled is better. Need to figure out if the blending or conversions are the more common operations. |
Blending isn't implemented for |
Restore the proper scale of Lab and Lch This restores the scale of Lab and Lch to be the same as in all of the specifications within reach. That is: - Lab::l and Lch::l goes from 0 to 100, - Lab::a and Lab::b goes from -128 to 127, - Lch::chroma goes from 0 to about 128-181. Also added additional tests for Lab <-> Lch and Lab<->Xyz conversions. Removed tests for lab and lch from the color mine data as it is not accurate. This is a breaking change, since everything that uses these values directly will be wrong. Closes #49.
Continuing discussion from #48.
Lab values are currently scaled, L by 100 and a and b by 128. Even though a and b are unbound, typical ranges are -128 to 128.
By my limited research so far, I have not seen scaled lab values used ( unlike rgb which is usually assumed in the range 0-1 ). For example Conversion formula's, Color Difference formula's and most research papers assume unscaled lab values (I am happy to be corrected on this).
Right now using the lab spaces implies unnecessary scaling when used practically. So I am proposing that the Lab values should be changed to be unscaled. Same for Lch values.
If the decision is to still scale the value, we should provide a new_from_unscaled and into_unscaled function, to get values in and out.
The text was updated successfully, but these errors were encountered: