From a0e40a389ea0cb26f019483030918b13e07cf0fd Mon Sep 17 00:00:00 2001 From: emotion3459 <176516814+emotion3459@users.noreply.github.com> Date: Mon, 14 Oct 2024 17:31:15 -0400 Subject: [PATCH] Update value scaling --- vsaa/funcs.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vsaa/funcs.py b/vsaa/funcs.py index fdbd4c3..ab749a1 100644 --- a/vsaa/funcs.py +++ b/vsaa/funcs.py @@ -133,7 +133,7 @@ def clamp_aa( if mask: if not isinstance(mask, vs.VideoNode): - bin_thr = scale_value(mthr, 32, clip) + bin_thr = scale_value(mthr, 32, clip, range_out=ColorRange.FULL) mask = ScharrTCanny.ensure_obj(mask).edgemask(func.work_clip) # type: ignore mask = box_blur(mask.std.Binarize(bin_thr).std.Maximum()) @@ -266,9 +266,10 @@ def based_aa( downscaler, supersampler = supersampler, downscaler if mask and not isinstance(mask, vs.VideoNode): + mask_thr = scale_value(min(mask_thr, 255), 8, func.work_clip, ColorRange.FULL, ColorRange.FULL) mask = EdgeDetect.ensure_obj(mask, based_aa) mask = mask.edgemask(plane(func.work_clip, 0)) - mask = mask.std.Binarize(scale_value(min(mask_thr, 255), 8, func.work_clip, ColorRange.FULL)) + mask = mask.std.Binarize(mask_thr) mask = box_blur(mask.std.Maximum()).std.Limiter() if show_mask: