Open tdbe opened 2 years ago
I've heard that chroma does NOT support "round trip", but I personally think they should as well.
+1 from me 👍🏼
Had some base colors defined in HEX, got their LCH values and then setting new colors based on the same LCH values and converting it to HEX and the HEX values would be different to the expected values.
Nice to see I wasn't crazy 🙂 I -guess- the problem here is there is loss of information going through all these color spaces and a lot of assumptions or approximations must happen to make a round trip.
But it would be amazing if they actually wrote this in like the start of their readme.md: "hey I know you're expecting to get color conversions out of this, but they don't make the round trip because of reasons" 🙂
Hi, I ported your code to GLSL because I need to do gpu hue adjustments on CIE colors, so I needed to convert to LCH to change the hue, but I noticed that, without making any changes to the color, doing
RGB - XYZ - LAB - LCH - LAB - XYZ - RGB
I get a completely different result from the starting color. I am still fairly new to CIE so maybe I am not understanding it right? Is it not meant to work in a round trip? Just want to confirm at least if it's indeed supposed to work.I did notice that if I do
RGB - XYZ - Lab - XYZ - RGB
, everything is correctly identical. When I involve LCH which is the only way I know how to change the Hue, I get broken results whether I change the hue or not.My ported code, everything is done right AFAIK:
[EDIT]
I found this shadertoy in the meantime, and the code here makes the round trip and I can change hue. But the LCH code there is baked in with the LAB conversion, uses a lot of magic numbers etc, so I can't tell what's wrong here.
Anyway, at least this answers the question of "Is it not meant to work in a round trip?" I guess it is, and I am assuming (hoping) it's my fault somewhere and not the repo's