Skip to content

Commit

Permalink
Fix flat_mask thr scaling
Browse files Browse the repository at this point in the history
  • Loading branch information
Setsugennoao committed Nov 12, 2024
1 parent fb7ab11 commit cef1693
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion vsmasktools/spat_funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,9 @@ def flat_mask(src: vs.VideoNode, radius: int = 5, thr: float = 0.011, gauss: boo

blur = gauss_blur(luma, radius * 0.361083333) if gauss else box_blur(luma, radius)

mask = depth(luma, 8).abrz.AdaptiveBinarize(depth(blur, 8), scale_value(thr, 32, 8))
blur, mask = depth(blur, 8), depth(luma, 8)

mask = mask.abrz.AdaptiveBinarize(blur, scale_value(thr, 32, blur))

return depth(mask, luma, dither_type=DitherType.NONE, range_in=ColorRange.FULL, range_out=ColorRange.FULL)

Expand Down

0 comments on commit cef1693

Please sign in to comment.