anton_foy
11th September 2022, 19:56
Hi, is there a quick and simple way to change max white color to black?
Even would like to expand spatially so the neighbouring pixels of the max white area also gets black.
Right now I do it like this:
function b_edge(clip c, int "thresh", int "br")
{
bemask = c.mt_binarize(threshold=thresh).mt_expand().removegrain(20,-1)
blc = c.levels(0,1,255*256,0,(br*256))
mt_merge(c,blc,bemask,y=3,u=1,v=1)
return last
}
But it is quite slow.
Even would like to expand spatially so the neighbouring pixels of the max white area also gets black.
Right now I do it like this:
function b_edge(clip c, int "thresh", int "br")
{
bemask = c.mt_binarize(threshold=thresh).mt_expand().removegrain(20,-1)
blc = c.levels(0,1,255*256,0,(br*256))
mt_merge(c,blc,bemask,y=3,u=1,v=1)
return last
}
But it is quite slow.