diff --git a/vsdehalo/alpha.py b/vsdehalo/alpha.py index f562822..f86b190 100644 --- a/vsdehalo/alpha.py +++ b/vsdehalo/alpha.py @@ -202,7 +202,7 @@ def __call__( raise CustomValueError('valid values for show_mask are 1–7!', func) thmif, thmaf, thlimif, thlimaf = [ - scale_value(x, 8, clip, ColorRange.FULL) + scale_value(x, 8, clip, ColorRange.FULL, ColorRange.FULL) for x in [thmi, thma, thlimi, thlima] ] @@ -703,7 +703,10 @@ def dehalomicron( dehalo_mask = RemoveGrainMode.MINMAX_MEDIAN_OPP(dehalo_mask) if brz: - dmask_expr = f"x {scale_value(abs(brz), 32, y, ColorRange.FULL)} {'>' if brz < 0.0 else '>'} 0 x 2 * ?" + dmask_expr = ( + f"x {scale_value(abs(brz), 32, y, ColorRange.FULL, ColorRange.FULL)} " + f"{'>' if brz < 0.0 else '>'} 0 x 2 * ?" + ) else: dmask_expr = 'x 2 *' diff --git a/vsdehalo/mask.py b/vsdehalo/mask.py index 67149e9..a1503cd 100644 --- a/vsdehalo/mask.py +++ b/vsdehalo/mask.py @@ -43,7 +43,7 @@ def base_dehalo_mask( exp_edges = norm_expr( [luma, Morpho.maximum(luma, iterations=2)], 'y x - {shift} - range_half *', - shift=scale_value(shift, 8, luma, ColorRange.FULL) + shift=scale_value(shift, 8, luma, ColorRange.FULL, ColorRange.FULL) ) edgemask = PrewittTCanny.edgemask(exp_edges, sigma=sqrt(expand * 2), mode=-1, multi=16) diff --git a/vsdehalo/warp.py b/vsdehalo/warp.py index 1221fff..a484e2c 100644 --- a/vsdehalo/warp.py +++ b/vsdehalo/warp.py @@ -63,8 +63,8 @@ def edge_cleaner( y_mask = get_y(work_clip) mask = edgemask.edgemask(y_mask).std.Expr( - f'x {scale_value(4, 8, work_clip, ColorRange.FULL)} < 0 x ' - f'{scale_value(32, 8, work_clip, ColorRange.FULL)} > {peak} x ? ?' + f'x {scale_value(4, 8, work_clip, ColorRange.FULL, ColorRange.FULL)} < 0 x ' + f'{scale_value(32, 8, work_clip, ColorRange.FULL, ColorRange.FULL)} > {peak} x ? ?' ).std.InvertMask() mask = mask.std.Convolution(mean_matrix) @@ -80,13 +80,13 @@ def edge_cleaner( mask = edgemask.edgemask( diff.std.Levels( - scale_value(40, 8, work_clip, ColorRange.FULL), - scale_value(168, 8, work_clip, ColorRange.FULL), + scale_value(40, 8, work_clip, ColorRange.FULL, ColorRange.FULL), + scale_value(168, 8, work_clip, ColorRange.FULL, ColorRange.FULL), 0.35 ) ) - sc4 = scale_value(4, 8, work_clip, ColorRange.FULL) - sc16 = scale_value(16, 8, work_clip, ColorRange.FULL) + sc4 = scale_value(4, 8, work_clip, ColorRange.FULL, ColorRange.FULL) + sc16 = scale_value(16, 8, work_clip, ColorRange.FULL, ColorRange.FULL) mask = removegrain(mask, 7).std.Expr(f'x {sc4} < 0 x {sc16} > {peak} x ? ?') final = final.std.MaskedMerge(work_clip, mask)