- https://
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections.abc import Callable | |
import vapoursynth as vs | |
core = vs.core | |
from vstools import depth, get_peak_value, get_lowest_value, get_y | |
def lee_banding_mask(clip: vs.VideoNode, bits: int = 2, threshold: int | None = None, edge_detection: Callable = core.std.Sobel): | |
""" | |
False contour detection via bit depth reduction. The idea is (overly) simple: Re-quantize and find difference to input, calculate the gradient, and mark gradients under a threshold as false contours. | |
Naturally, this only works on content that isn't naturally flat. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import vapoursynth as vs | |
from vstools import depth, scale_value | |
core = vs.core | |
def fade_clipped(src: vs.VideoNode, | |
flt: vs.VideoNode, | |
lower: float = scale_value(16, 8, 32, scale_offsets=True), | |
upper: float = scale_value(235, 8, 32, scale_offsets=True), | |
amount: float = scale_value(10, 8, 32, scale_offsets=True)) -> vs.VideoNode: | |
diff_upper = f"{upper} x -" |
OlderNewer