Jaded-Encoding-Thaumaturgy / vs-deband

Various debanding tools for VapourSynth
MIT License
15 stars 7 forks source link

Average brightness normalization step to graining #95

Closed ghost closed 9 months ago

ghost commented 9 months ago

Sometimes grainers or the postprocessing done to them can shift the average brightness of the image. We can easily fix this with a simple core.akarin.Expr(grained.std.PlaneStats(), "x 0.5 x.PlaneStatsAverage / *") Where grained is the grain applied to the blankclip, this will normalize the average brightness to 0.5 (which will be the average brightness of a blank clip in integer bitdepths, I believe for float we want to use 0). Ideally this postprocessing should be done after FadeLimits is applied in order to reduce any issues introduced by clipping.