Log in

View Full Version : Dehalo just the right or left side of edges


SaurusX
9th November 2021, 22:24
Often in animation (and I'm sure elsewhere) there's the issue of asymmetrical edge enhancement to only one side of dark edges. My solution is the approach below, but is there another more elegant approach? I don't know of a dehalo filter that doesn't automatically assume symmetrical haloing.

a=last
#use edgesidebleed to build mask of right-side edges and invert
rside=edgesidebleed(w32=.000,w16=.00,w8=.0,w4=.00,w2=.015).edgesidebleed(w32=.000,w16=.00,w8=.0,w4=.00,w2=.015).edgesidebleed(w32=.000,w16=.00,w8=.0,w4=.00,w2=.015).\
edgesidebleed(w32=.000,w16=.00,w8=.0,w4=.00,w2=.015).mt_binarize(threshold=150).invert()
#create edge mask
edgmask=hysteria(showmask=false,luma_cap=150,lowthresh=8,highthresh=11,strength=3).Temmod(threshY=12).mt_inflate()
#subtract left side from edge mask leaving only right
halomask=overlay(edgmask,rside, mode="subtract")

#apply dehaloing with mask to only affect right side
overlay(a,dehalo_alpha(ry=.01,rx=1.6,darkstr=0,brightstr=.6,ss=2,cs=true),mask=halomask)

Emulgator
10th November 2021, 20:15
Convolution is your friend, but cumbersome to find parameters.
https://forum.doom9.org/showthread.php?t=182604

real.finder
10th November 2021, 21:29
LGhost/vsLGhost will do it

also you can try https://github.com/realfinder/AVS-Stuff/blob/a487858224a063101b9bfc1e128a0953ee6c5046/avs%202.5%20and%20up/AdvancedDenoising.avsi#L208