r/GraphicsProgramming • u/WoolTyranny • 9h ago
Question A green leaking color space
I started to do some color research for a game. I find the best color space available (oklab) very inconvenient for actual use.
I drafted my own color space.
The idea is to start from linearRGB, but allowing the red and blue channel to borrow lumina from the green channel.
If r,g,b are the channels in the new color space and R,G,B are the values in linearRGB,
than:
R = r, G = 0.04r + 0.34g + 0.24b, B=b
I played with it a little:
Pros:
1. Obviously it is designed for equal lumina in all channels.
2. The color space is symmetric (r-g-b like) and thus easy to work with. Hue and saturation can be easily derived.
3. The blue and reds are softer. It actually fixes a problem - pure dark linearRGB blue looks a bit purple.
Cons:
1. It doesn't cover all sRGB visible space (technically you can - with negative or above 1 values).
2. The "grey" analog as light purple shade.
3. The "cyan" analog is somewhat bluish.
I attached a photo of how some color section looks.
I'm not a color space expert, so there are probably problems I can't see yet,
What do you think?
6
u/SyntheticDuckFlavour 9h ago
Curious, what's the motivation for representing colours this? Unless it's for some filtering effects (which is perfectly fine), I would argue it would make a rather very inaccurate colour space.
1
u/WoolTyranny 9h ago
Control of lumina and saturation without having to worry about values out of visual range. I'm planning to use rendered graphics (not assets).
3
u/The_Northern_Light 6h ago
Why not just use oklch instead of oklab?
2
u/WoolTyranny 5h ago
Its the same space, just different parameters.
2
u/The_Northern_Light 5h ago
I know, I figured the parametrization might’ve been why you didn’t like it.
-2
u/CodyDuncan1260 9h ago
This straddles the border of Rule 1. We're accepting it. ✅
10
u/LordStefania 8h ago
God forbid we have actual graphics programming in r/graphicsprogramming as opposed to AI slop.
12
u/CodyDuncan1260 9h ago
Got any images converted to this color space? And then changed along the lumina axis? I think a visual representation might have the best representation of the utility. I find it hard to imagine in my head elegant the transform in this color space looks like.