Hi, I found some time to play again and I got a fractional scrolling

Hi, I found some time to play again and I got a fractional scrolling working. It looks way better than the tetris-style integer shifting I showed here the last time.

Although I´m pretty sure that the math I´m doing is correct, the result looks not as perfect smooth as I expected.

Why that? The gamma curve / correction seems to be the problem.

Some details: When doing a one dimensional fractional scrolling I take the values of the 2 involved pixels, scale them down in order to represent the desired blend (the sum of the 2 scale ratios has to be 255), add the results and write them back.

So in the middle between 2 pixels I scale both down to 50 percent.

To get the trick fully working, I need a gamma curve, where 2 leds next to each other lighting at 50 percent each are (edit: look) EXACTLY as bright as one led at full brightness.

And that´s my problem now. On the SmartMatrix without any correction the result of 2 half dimmed leds is too bright, with the build in color/gamma correction the result is too dark. The result is too blurred or too unstedy pixelated…

So back to my soft scrolling approach: the movement itself is as fluid as I wish, but the color trasition is not.

Any thoughts, what I could do to improve that?

edit: and what is it good for? For stuff like that:

This is definitely a challenge to get “just right”-- it has a lot to do with perceived brightness, which is a tricky business.

I have had some luck with an approximation that uses a “dim8” function as a correction. Try dim8_video as the gamma correction.

But you’re totally right: two pixels lit at 127 appears FAR brighter than one pixel at 254.

Thanks for the tip, Mark! I tested it with a line mesh scrolling slowly along x. Tryed dim8_video and dim8_raw.

The transition of the vertical lines looks much better then before. The perceived width of the vertical lines appears right.

Unfortunately the horizontal lines (drawed with a plain color) show a pulsating brightness now.
I guess, because the resulting sum of the 2 corrected values is not always 255.

The solution of the alleged simple task turns out to be more complex than expected.

Any way arround a serious led RGB gamma calibration with some test-pictures and many parameters to adjust in order to get the curves bended right for every color channel?

Oh, one other thing- the Green channel on the SmartMatrix LEDs is much brighter than the Red or Blue. I’ve been using this for my basic color correction:
FastLEDS.addLeds<SMART_MATRIX>(leds,NUM_LEDS)
.setCorrection(CRGB(255,80,178));
Note the crazy-low Green adjustment factor! (Disclaimer: these values were arrived at by nothing more than repeated trial and error.)

I mention it because without balancing the relative brightness of the R G and B, it’s basically impossible to balance color brightnesses across pixels.

Also: are you doing your calculations with CHSV or CRGB? CHSV has a call to dim8 built in to the “V” parameter – so there’s some gamma correction going on already there.

I see, there is more to explore.
I do the calculations with CRGB.

With dynamic video data it looks better then with a never forgiving static line-mesh.

So that´s what I have for now with some try and error correction here and there:

With accum88 style math the transition quality is pretty cool. So there is “just” the color finetuning left to do to give it all a bit more sharpness and contrast. :slight_smile:

There is so much hidden beauty in the noise…