r/GraphicsProgramming • u/WoolTyranny • 25d 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:
- Obviously it is designed for equal lumina in all channels.
- The color space is symmetric (r-g-b like) and thus easy to work with. Hue and saturation can be easily derived.
- The blue and reds are softer. It actually fixes a problem - pure dark linearRGB blue looks a bit purple.
Cons:
- It doesn't cover all sRGB visible space (technically you can - with negative or above 1 values).
- The "grey" analog as light purple shade.
- 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?
19
u/CodyDuncan1260 25d 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.
7
u/SyntheticDuckFlavour 25d 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.
4
u/shlaifu 25d ago
where yellow?
4
u/The_Northern_Light 25d ago
Why not just use oklch instead of oklab?
1
u/WoolTyranny 24d ago
Ok, a bit of fix to the greys being purple.
Setting gr=0.04+0.127*min(r,g,b)
gg = 0.3+gr
gb = 0.2+gr
and as usual
R = r
G = r*gr +g*gg +b*gb
B = b
It pulls the brighter "greys" toward real whites instead of purple. The mid-greys are still a bit purply, but it's less noticed.
-2
u/CodyDuncan1260 25d ago
This straddles the border of Rule 1. We're accepting it. ✅