Skip to content

Commit

Permalink
Fix protect_chroma
Browse files Browse the repository at this point in the history
  • Loading branch information
emotion3459 committed Oct 23, 2024
1 parent 76c1986 commit 263082d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions vsdeband/noise.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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])
Expand Down

0 comments on commit 263082d

Please sign in to comment.