Comments (4)
Added some demos.
from coloraide.
As far as interpolation goes, it just seems that Oklab approaches white more slowly than it does black. With black, it gets very close much quicker with a number of points very, very close to black, whereas white approaches slower, so the points are spaced out a bit more close to white.
This isn't uncommon with different color spaces though. CIE LAB and CIE LUV are basically the same as Luv is directly derived from CIE LAB. Jzazbz is pretty close to CIE LAB as well. But DIN99o, Oklab, and ICtCp all approach black faster with DIN99o doing it the slowest out of the three and ICtCp doing it the fastest: Demo.
Using something like Oklrab, which has an adjusted lightness that matches CIE LAB much closer, you'd get something more on par (in regards to lightness) when comparing with CIE LAB.
Again, I'm not sure any of this is really a problem really, but just pointing out that there is a difference. I mean, if you interpolate in the srgb-linear
range, you get the opposite problem as sRGB Linear approaches white much quicker than sRGB and CIE LAB. This is the opposite behavior compared to Oklab. None of this is "wrong", just behaviors of the space.
from coloraide.
In the end, when it comes to gamut mapping, I think things make a bit more sense to me now. The washed-out blue I believe is caused simply because the color converts to sRGB giving negative red and green channel values. When converting to Oklab, you get a different color than what CIE lab gives, which is expected as Oklab generally does better hue preservation.
Hue doesn't really change much from what it originally converted to before gamut mapping in Oklab. Some colors it may shift a little, simply due to the distance threshold, but you "could" tighten it up with an even lower threshold, but I feel that is unnecessary. Certain colors simply have more steps between them, I don't think ∆Eok is perfect, but OK for what we are doing with gamut mapping. Anyways, I have some examples comparing Lch chroma and Oklch chroma. In some cases, we push the blue channel past reasonable limits -- Lch, in these extreme cases, breaks down and turns to purple while Oklab still remains bluish. Demo.
Anyways, I'm feeling better about gamut mapping with Oklab and generally using Oklab for interpolation. I still wonder if the darker leaning of Oklab when interpolating is desired, but the user can always fall back to the Lch variant if they desire it. Worst case, maybe we can use Oklrch in the future 🤷🏻 .
from coloraide.
We are gamut mapping with Oklch by default via 7335171.
Interpolation is still done using Lch for now.
from coloraide.
Related Issues (20)
- CSS Hue handling for longer HOT 5
- Serialize alpha as percent HOT 1
- HSL and HWB non-legacy CSS (space format) do not need to be forced to percentage output HOT 1
- Typing deep matrices (tensors)
- Correct negative saturation in HSL HOT 2
- Channel clipping/mapping should be applied to the Gamut mapping space, not origin space HOT 1
- Don't artificially clamp chroma and lightness HOT 5
- Allow controlling the JND of gamut mapping HOT 1
- Tonal Palettes
- Add extended Oklab (if it becomes viable)
- Allow full degree syntax in `color()` functions HOT 1
- Add new GMA algorithm HOT 1
- Maybe make a general ray trace GMA that a user can feed in any LCH space HOT 6
- Should gamut mapping default to ray tracing GMA in the future?
- Should compositing gamut map colors before proceeding?
- Spaces like HCT should respond with their own achromatics
- Should we normalize spaces with viewing conditions? HOT 3
- Unable to convert colors? HOT 4
- How to confine manipulated colors to sRGB space HOT 2
- Improve monochromatic harmony
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from coloraide.