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 25, 2024
1 parent 76c1986 commit b24c5c0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 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,7 @@ 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 ?'
)

grained = grained.std.MaskedMerge(merge_clip, neutral_mask, [1, 2])
Expand Down

0 comments on commit b24c5c0

Please sign in to comment.