Live data from Hacker News

Oklab: A perceptual color space for image processing

bottosson.github.io

91–94 of 94 posts

Re: Oklab: A perceptual color space for image processing

#91
post #90

Earlier quoted context omitted.

Personally I use this tool I built as a Photoshop action over a decade ago, https://www.hcs.harvard.edu/~jrus/colortheory/jl.html (see the animation at the bottom showing almost precisely what you are asking about) Initial discussion: https://www.ledet.com/margulis/2010HTM/ACT08-Jacobs_Ladder.h... An HSV hue shift (or whatever similar thing you are thinking of) yields horrible results in this use case.

That example looks like it's working directly with RGB, which I expect to be correct. I've also seen it work well in HLS. But I worked on a tool where we were told to change from HLS to CIELab because it would be better, and it turned out to be much worse in practice.

I almost always use CIELAB as a working color space for photographic work (my action linked previously converts to 16 bit/channel CIELAB space as its first step, though you could use a similar type of tool in RGB mode if you wanted to). But I have a pretty good idea of the final RGB (or other) gamut I am aiming for.

Photoshop is definitely designed RGB-first, and some of the tools get a bit clunky in CIELAB mode. It is still an improvement for most of what I want to do.

I have many ideas for better image color manipulation tools.

Re: Oklab: A perceptual color space for image processing

#92

Earlier quoted context omitted.

https://gitlab.com/wg1/jpeg-xl/-/blob/master/lib/jxl/opsin_p... has the numbers for sRGB to XYB. Basically the M1 matrix for linear sRGB [linearR, linearG, linearB, 1] to approximate cone responses: (I think in this normalization 1 means 250 nits, but not completely sure at this stage of optimizations -- we changed normalizations on this recently.) M1 = [ [0.300, 0.622, 0.078, 0.0038], [0.240, 0.682, 0.078, 0.0038],…

Thanks! Regarding: “Cube is beautiful in the sense that it allows scaling the intensity without considerations, but it is quite awful in the near black psychovisual performance.” Yeah, that is the tradeoff, same for dealing with hdr values. The idea with Oklab is to avoid having to know what luminance the eye is adapted to, by treating all colors as if they are within the normal color vision range basically. Makes it…

BTW, just if it didn't become clear from all the proposals I had: I adore your work with Oklab. Humanity would benefit a lot if more scientists and engineers were able to think like you -- from first principles and completely out-of-the-cargo-cult-box. What you propose with Oklab is practical and a huge improvement over the current practice.

Re: Oklab: A perceptual color space for image processing

#93

Earlier quoted context omitted.

Nice! Definitely the the type of use case I had in mind.

I added Oklab to the Observable notebook. With the current set of palettes, it produces results that are very similar to Lab, but I imagine with some specific color/hue transitions Oklab will outperform Lab. https://observablehq.com/@mattdesl/perceptually-smooth-multi...

Yeah, should be similar a lot of the time. Deep blues are the colors that are the most different.

Re: Oklab: A perceptual color space for image processing

#94

Earlier quoted context omitted.

Thanks! Regarding: “Cube is beautiful in the sense that it allows scaling the intensity without considerations, but it is quite awful in the near black psychovisual performance.” Yeah, that is the tradeoff, same for dealing with hdr values. The idea with Oklab is to avoid having to know what luminance the eye is adapted to, by treating all colors as if they are within the normal color vision range basically. Makes it…

BTW, just if it didn't become clear from all the proposals I had: I adore your work with Oklab. Humanity would benefit a lot if more scientists and engineers were able to think like you -- from first principles and completely out-of-the-cargo-cult-box. What you propose with Oklab is practical and a huge improvement over the current practice.

Thanks a lot for the kind words!
Post reply on HN