Log in

View Full Version : Add Analog-like Sharpening Halos to SD Video


SaurusX
4th July 2022, 21:17
While messing around with AI upscalers I found it would be convenient if I could add my own edge enhancement sharpening halos in order to train the neural net to remove them. This seems to work fantastically creating authentic looking haloing.

a=last
b=last.TEMmod(threshY=17).mt_expand.mt_expand.mt_expand
c=last.TEMmod(threshY=17).mt_expand
b=overlay(b,c,mode="subtract").mt_deflate()
dark=generalconvolution(matrix="0 0 0 0 1 0 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 0 -2 0 0 0 0 0 0 0 0 2 0 0 0 0 1 -1 -2 2 1 2 -2 -1 1 0 0 0 0 2 0 0 0 0 0 0 0 0 -2 0 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 0 1 0 0 0 0",chroma=false)
generalconvolution(matrix="0 0 -2 0 0 0 0 2 0 0 -2 2 1 2 -2 0 0 2 0 0 0 0 -2 0 0",chroma=false)
overlay(last,dark,mask=b)

https://imgsli.com/MTE1MjY3

Could maybe use some tweaks or further finesse.