Repository navigation
dark color mixing regression? #4794
Description
Activity
Due to new way gamma is handled (which is now correctly applied as a last step).
So you are saying this is the correct behavior?
(and everyone who likes colors should simply turn off gamma correction? ^^)I can't answer that but gamma is supposed to be applied only as a last step in image manipulation. And now it is. In the past Gamma was applied immediately when color was selected and every calculation worked on gamma modified color.
Well I believe it doesn't really matter when you convert between color spaces, but you need to make sure that the math you are using is the correct one that is applicable for each color space. If you simply move the conversion to a different place, but don't replace all math that happens in between, I can see how that would produce different results.
sRGB is an exponential color space, so you can't do linear math in it (despite the fact that most people do anyway). I would assume that the RGB colors of WLED are sRGB, are they not? And further I would assume (without knowing much about it), that LEDs are addressed in a linear color space. With these assumptions I would arrive at the conclusion that the gamma correction would have to be done as early as possible. Again, that is without ever having looked at color spaces in the context of LEDs.
In any case, if you look at the picture, you will notice that there is no hint of mixed colors, just pure red, green and blue, in varying intensities. I don't think that can be a correct result when your input is yellow, cyan or magenta.
can't reproduce: fixed in #4711
edit:
thanks for making me check, I found a different bug :)what are you settings for color correction? needs to be "Use Gamma correction for color" enabled and set to 2.2 to get the best match to the old looks. it will still look different at very low brightness but I see no black bands at 4 only below that.
I do agree that at low brightness it might need some tuning as we are running into a resolution problem and it really does not look good below a brightness of 10.The base issue is this: calling SetLuminance() in NPB will dim colors all the way to zero.
To solve it, this function of NPB can not be used and colors need to be scaled before passing them to NPB.colors of WLED are sRGB, are they not
WLED does not operate in any color space. It uses linear math and gamma is used to correct for human vision. I.e. a channel value of 127 is considered 50% of brightness.
what are you settings for color correction? needs to be "Use Gamma correction for color" enabled and set to 2.2 to get the best match to the old looks. it will still look different at very low brightness but I see no black bands at 4 only below that.
Color correction on, brightness correction off (whatever that means). gamma was at 2.8, I assume that is or used to be the default.
Indeed 2.2 works a bit better, but the brightness and colors still look inconsistent, and I still get black bands at brightness 3 or lower.
4a3af81 with gamma 2.8 has no black bands at brightness 1, and reasonable colors at least from brightness 3 upwards (3 colors at brightness 1, 6 colors at brightness 2 with the default palette). Same with gamma 2.2.
4a3af81 with gamma 2.8 has no black bands at brightness 1, and reasonable colors at least from brightness 3 upwards (3 colors at brightness 1, 6 colors at brightness 2 with the default palette). Same with gamma 2.2.
the black bands are fixable, the rest is a question of personal preference.
I don't think yellow looking like dark red/black/dark green personal preference, but that's just my opinion, I guess
I don't think yellow looking like dark red/black/dark green personal preference, but that's just my opinion, I guess
I meant in general. this is an edge case.
@TripleWhy I made a proof of concept: #4798
Reacted by Johnny ArcitecReacted by Johnny Arcitec
What happened?
I noticed that recent versions of the main branch produce artifacts when using dim brightness levels. I traced it to the merge of #4658.
Here is what 4a3af81 (before merge) looks like with the palette effect at global brightness 4:
And this is 23a51e0 (merge commit) with the same preset:
For completeness, I also added screenshots of the UI. There it looks the other way round.
To Reproduce Bug
Use low global brightness.
Expected Behavior
Some colors produce incorrect colors or off pixels on physical LEDs
Install Method
Self-Compiled
What version of WLED?
WLED 0.16.0-alpha (build 2412040)
Which microcontroller/board are you seeing the problem on?
ESP8266
Relevant log/trace output
Anything else?
No response
Code of Conduct