question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hue/sat gamma correction results in off primary colors

See original GitHub issue

As #2017 got rather messy as I was figuring stuff out, one of the discovery will be documented here.

Intro

When messing around with hue/sat, mostly when testing enhancedHue vs Hue I noticed colors when set where off, for the primary colors. They seem to be more washed out.

Problem

Skipping https://github.com/Koenkk/zigbee-herdsman-converters/blob/cf864be3828ad542cbfcbee2c73d4687e4e43cad/converters/toZigbee.js#L897 seems to help for somewhat, but they still look a bit washed out. (Both with Innr and Tint, so I think it’s a general thing and not a brand specific issue)

So I’m not convinced that is the issue, aside from that there are also some odd out of range values send from time to time.
But the later is fixed by switching to value.saturation = Math.min(255, hsv.s * (2.54)); as mentioned here https://github.com/Koenkk/zigbee-herdsman-converters/issues/2017#issuecomment-753666345

I wonder if we should only apply the gammeCorrection for enhancedHue and not Hue? I couldn’t find much info on why we are doing this correction. Not that it will fix the washed out colors though.

It might be a brightness issue? as lowering the brightness to around 250 instead of 255 gives close to the same result with xy vs hs… which is interesting.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:16 (16 by maintainers)

github_iconTop GitHub Comments

1reaction
sjorgecommented, Jan 23, 2021

Innr E14 and Tint GU10 both need enhancedHue to be false for them to take a moveToHueSat command.

I was going over my code and noticed I had the ugly hack in there for Tint GU10 from testing because it has the same model as the Tint E27… which does support enhancedHue and I havent figured out a proper figure print for it. (I had a check against IEEE adress to toggle it off for my Gu10)

So the pattern is clear ish I think, we need to apply gammaCorrection for bulbs that do enhanchedHue and skip it for those that don’t!

0reactions
sjorgecommented, Jan 23, 2021

I managed to get the GU10 split of and did a bunch of more testing.

The Innr RB 250 C and the ML Tint GU10 look a bit off with and without gammaCorrection, neither looking objectively better than the other. To keep thing consistent, I think it’s best to just leave gammaCorrection in place.

For now my strategy is to use XY for both of these bulbs and use Hue/Sat for my others, as Hue/Sat does give better results on my Osram/Hue/Innr RB 285 C/Tiny E27… ¯_(ツ)_/¯

Read more comments on GitHub >

github_iconTop Results From Across the Web

Hue, Value, Saturation
Color consists of three main integral parts: hue; value; saturation (also called “chroma”). Let's start with “hue“. Hue is more specifically described ...
Read more >
Adjust color, saturation, and hue - Adobe Support
The Hue/Saturation command adjusts the hue (color), saturation (purity), and lightness of the entire image or of individual color components ...
Read more >
Gamma Correction - LearnOpenGL
You can see that with gamma correction, the (updated) color values work more nicely together and darker areas show more details. Overall, a...
Read more >
HSL and HSV - Wikipedia
HSL (for hue, saturation, lightness) and HSV are alternative representations of the RGB color model, designed in the 1970s by computer graphics researchers ......
Read more >
CGSD Gamma Correction and Color Space
Gamma Correction and Color Space. Gamma does not affect the representation of a color in all color spaces equally and has no affect...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found