-
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
Implement Oklab and Oklch #222
Comments
There is an open, but currently inactive, PR for Oklab: #200. We decided to only allow conversion if the current color space is using D65, so chromatic adaptation has to be done "manually", to avoid making it too "magic". Keeping converting and adaptation separate makes the type inference less brittle and implementations simpler. Not to mention leaving the matrix selection to the user. My intention for the PR is to either let it sit until I have gotten around to make a release, or to make sure it's solid and includes Oklch as well. And let's not worry about the boiler plate for now. |
I saw that PR like... five minutes ago, and now I am wondering how I missed it... |
Implemented in #200. |
Oklab is a simple perceptual color space that aims to be a more uniform replacement of CIE Lab. It mostly delivers on that goal in its intended use of D65 whitepoint SDR colors.
Oklch is natural cylindrical variant of Oklab. The author also had the idea of a sRGB-in-Oklch boundary in gamut mapping, which I mentioned in #221.
The basic XYZ-to-oklab definition is based on an assumption of D65 whitepoint. Any chromatic adaptation would be an extension. For that I recommend going with the CAM16-UCS matrix, since that's where its data for fitting comes from (Bradford is probably close enough too). (You could use the pseudo-LMS implied by the M1 matrix to do that, but it's not designed for that purpose and there's probably no real computational savings.)
(I am super fine with putting this off until we figure out how to write less boilerplate. In my dream world you would just tell a very intelligent thing which are which, but macros need humans to write too.)
The text was updated successfully, but these errors were encountered: