light
light copied to clipboard
Smooth brightness transitions
Allows smooth brightness transitions, as requested in #33. The length of time over which to interpolate can be set with the -t
command line argument (in milliseconds). The length of each brightness step is currently not configurable (set to 10 milliseconds). By default -t
is set to zero, so the default behaviour is unchanged.
This is using a simple for-loop with a usleep
delay. As mentioned in the above issue, this method has problems with race conditions until #72 is dealt with. However, in practice it already seems to work ok on my hardware. The brightness can end up at weird decimal values if changed quickly, but there is no 'jittery' behaviour and brightness always changes smoothly.
Thank you a ton for your effort! According to my very personal subjective opinion, I believe that this solution isn't something that should be pulled in to the repo, but that we should wait until we can do it properly. The reasoning is, even if you haven't been affected by potential issues, many people surely will if this is made official. Then again the functionality is optional..
I still think it's a great PR, and I think many people would want this. So I will leave this open for visibility (so others can clone your branch), and also so people can express their thoughts on it (maybe this is something we want pulled in?).
Again, thanks for contributing! This program wouldn't be nearly as well-developed if it weren't for people like you.
I could propose using series of box filters, started by one median filters. Median is effective at first stage against micro-fluctuations and two more boxes of same size are just enought to make a smooth curve.
For example - I have it in own backlight-adaptive, which is attempt to get adaptive backlight - shell script, using ffmpeg-based pipeline, with calculations done by awk. In my setup, with webcam configured to 30fps, I have it like 9,6,6 (first is median). Median should be simple as all it needs is sort, and there should be some ready sort implementations.