Mark Kriegsman   I'm still searching for the cause of the different behavior of

@Mark_Kriegsman I’m still searching for the cause of the different behavior of the FastLED spectrum_hsv in combination with a gamma correction curve.
(see also this post: https://plus.google.com/100115767703084101160/posts/483GAFbQJiL)
Putting the dither on the value works, however I’d like to put dither on RGB because I’d like to use a ColorPalette (with RGB blended colors).

I made a little video to show the difference between the FastLED HSV and “my own” HSV conversion (http://www.kasperkamperman.com/blog/arduino/arduino-programming-hsb-to-rgb/). Of course I’d like to use the FastLED version, because of the speed. Of course the video is not representative for the difference in real life, but it gives a first impression.

With FastLED HSV the primary colors (red, green, blue) are corrected different then the colors in between (which stay weaker). I came across that when trying the HexaWS2812 dithering, but with non-dithered correction curve the effect is there as well. However with the FastLED dim8_video its less noticeable.

It happens in both the AVR as the C version of the conversion.

Code to test on a Ledstrip:

No need to modify FastLED and external hardware isn’t needed either.
https://gist.github.com/kasperkamperman/3f5415d609c176f3da74
http://www.youtube.com/watch?v=oeK70_axTrA

Super helpful video!
I have a theory, which could be tested by looking at the numeric output of the conversion functions (instead of eyeballing the LEDs). The theory is that ‘gamma correction’ of individual channels for R G and B is not at all the same as ‘gamma correction’ of the overall brightness, and somehow that’s playing a role.

Consider Green (0x00FF00) versus Aqua (0x007F7F). Let’s say that they have the same brightness to start with, for the sake of discussion.

If we apply a dimming curve to each color channel independently (as I believe FastLED does, perhaps incorrectly!), the 0xFF value in the Green color is basically unchanged and the total light output is about ‘255’ units. Aqua starts off with 127 green and 127 blue, for a total of 254: roughly the same brightness as the green. However, the 0x7F (127) values in the Aqua are each independently dimmed down to about 0x40 (64) or something similar, and the result is that the total light output is 64 green plus 64 blue, for a total of 128 ‘units’ of light output!

So… that’s not right. :confused:

Ideally, we’d apply a gamma curve to the overall brightness, rather than to each channel. I bet I can do it easily and still fast, but now I have to think about how I want to re-arrange the code to do that.

And I also want to sleep on this and make sure I’m thinking about the problem correctly, but I bet this is, in fact, what’s going on.

Mental update: No, wait, that’s not quite it, either. I need a pencil and paper and a spreadsheet and a chart or two, but I definitely see the problem in the video and I think it IS somehow each-channel-separately vs. all-channels-together.

Good example about the aqua vs. green. I had the same thing in mind. However the question is why doesn’t that happen with the other HSVRGB conversion with the aqua colors?