GithubHelp home page GithubHelp logo

Comments (4)

facelessuser avatar facelessuser commented on June 14, 2024

Added some demos.

from coloraide.

facelessuser avatar facelessuser commented on June 14, 2024

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.

facelessuser avatar facelessuser commented on June 14, 2024

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.

facelessuser avatar facelessuser commented on June 14, 2024

We are gamut mapping with Oklch by default via 7335171.

Interpolation is still done using Lch for now.

from coloraide.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.