From 263082d53d7b6e37d30a4b5c2d5a1b18b94b506c Mon Sep 17 00:00:00 2001 From: emotion3459 <176516814+emotion3459@users.noreply.github.com> Date: Wed, 23 Oct 2024 13:24:22 -0400 Subject: [PATCH] Fix protect_chroma --- vsdeband/noise.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vsdeband/noise.py b/vsdeband/noise.py index 8af098c..0a0a29f 100644 --- a/vsdeband/noise.py +++ b/vsdeband/noise.py @@ -12,7 +12,7 @@ from vstools import ( CustomIndexError, CustomOverflowError, CustomValueError, InvalidColorFamilyError, KwargsT, Matrix, MatrixT, PlanesT, check_variable, core, depth, fallback, get_neutral_value, get_neutral_values, get_peak_value, get_sample_type, - inject_self, get_y, join, mod_x, normalize_seq, plane, scale_value, split, to_arr, vs + ColorRange, inject_self, get_y, join, mod_x, normalize_seq, plane, scale_value, split, to_arr, vs ) from .f3kdb import F3kdb @@ -307,8 +307,8 @@ def _try_grain(src: vs.VideoNode, stre: tuple[float, float] = strength, **args: neutral_mask = Lanczos.resample(clip, clip.format.replace(subsampling_h=0, subsampling_w=0)) neutral_mask = norm_expr( - split(neutral_mask), f'y {neutral} = z {neutral} = and {get_peak_value(clip, chroma=True)} 0 ?', - planes=[1, 2] + split(neutral_mask), f'y {neutral} = z {neutral} = and {get_peak_value(clip, range_in=ColorRange.FULL)} 0 ?', + format=neutral_mask.format.replace(color_family=vs.GRAY) ) grained = grained.std.MaskedMerge(merge_clip, neutral_mask, [1, 2])