Skip to content

Commit

Permalink
Update value scaling
Browse files Browse the repository at this point in the history
  • Loading branch information
emotion3459 committed Oct 14, 2024
1 parent 6fab305 commit a0e40a3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions vsaa/funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit a0e40a3

Please sign in to comment.