I have two questions about temporal dithering. Based on the documentation, I understand how the temporal dithering works on a per-pixel basis related to the global_brightness variable. For example, if global_brightness = 128 and the pixel is set to CHSV(0,0,11), my understanding is that the pixel will dither between CHSV(0,0,5) and CHSV(0,0,6). However, is there a way to just set the color to CHSV(0,0,5.5) with global_brightness = 255 and have it dither anyways? Also, I am working on a project where I need “spatial” dithering. Is there a way to say leds[1.5] += CHSV(0,0,10) and have half the value go to pixel 1 and the other half go to pixel 2? I am trying to get smoother movement, and it’s not clear to me from the documentation how to do that. Thanks!
For the first part - no, there isn’t yet. Though that may become available when I get 16-bit crgb support in.
For the second one you have to do the math yourself - e.g.
leds[1] += newcolor.scale8(64);
leds[2] += newcolor.scale8(192);
To put, say, 75% of newcolor into led[2] and 25% into led[1]
Thanks, Daniel. I seem to be having some trouble with leds[i][j] += oldLeds[i][j].nscale8(scaleFactor). Does nscale not play nice with array of arrays? I know nscale won’t work with leds.nscale8(scaleFactor) if leds is an array of arrays, but I would expect referencing an individual pixel using leds[i][j] should work.
@Daniel_Wilson1 referencing individual values from the array is not a problem. What trouble are you having exactly?
Temporal dithering? I think I just saw that on an old episode of Star Trek! It was the result of a dispacial-fracture in the the theta port deflector.