######################################################

What is “Banding”?

“Colour banding is a problem of inaccurate colour presentation in computer graphics. In 24-bit colour modes, 8 bits per channel is usually considered sufficient to render images in Rec. 709 or sRGB. However, in some cases there is a risk of producing abrupt changes between shades of the same colour. For instance, displaying natural gradients (like sunsets, dawns or clear blue skies) can show minor banding.”
More information (that applies to banding in anime as well)


Explained with a screen:

banding.jpg


How is it possible to do that without detail loss?

You need a debanding mask for that. Some debander like fag3kdb and gradfun3 have them already included. Meanwhile the normal f3kdb don’t. That isn’t bad though, because it gives you good options to use your own mask.
I recommend using retinex_edgemask. There are more than one way to use it.
A simple and fast way would be:

mask = kgf.retinex_edgemask(ref).std.Inflate()

Keep in mind that it just works as a edgemark like that and could kill little details, if you raise the deband value too high. Instead of just “std.Inflate()” you can use other options (or even combine them):

#Row 2
reb1=ret.std.Binarize(3000)
reb2=ret.std.Expr("x 2000 > x 10 * x ?") 
reb3=core.std.StackVertical([retb,rets])

#Row 3
ret1=ret.std.Inflate()
ret2=ret.std.Maximum().std.Inflate()
ret3=ret.std.Maximum().std.Maximum().std.Inflate().std.Inflate()

About the example “reb2”:
“x 2000 > x 10 * x ?” translates to “if pixel ‘x’ is greater than 2,000, multiply by 10, else do nothing” the number 2000 effects how much gets masked at all, and changing 10 affects the strength
For more help about handling Expr: HERE and HERE.


Picture examples:

Row 1: gradfun3/fag3kdb with det=2 & mask=1,2 and 3
Row 2: Look above
Row 3: Look above
Row 4: Source, denoised (no dither) and denoised (error diffusion)

rqxaqe.png

mzanne.png


A linked Github request with other information about that topic


 

Advertisements