rgtools ¶
Functions:
-
clense–Apply a clense (temporal median) filter based on the specified mode.
-
remove_grain–Apply spatial denoising using the RemoveGrain algorithm.
-
repair–Constrains the input
clipusing arepairclipby clamping pixel values -
vertical_cleaner–Applies a fast vertical median or relaxed median filter to the clip
Attributes:
Clense ¶
Clense(clense_func: Callable[P, R])
Class decorator that wraps the clense function and extends its functionality.
It is not meant to be used directly.
Classes:
-
Mode–Enum that specifies the temporal clense mode to use.
Methods:
-
__call__–
Source code in vsrgtools/rgtools.py
485 486 | |
Mode ¶
Bases: CustomStrEnum
Enum that specifies the temporal clense mode to use.
Clense modes refer to different ways of applying temporal median filtering over multiple frames.
Each mode maps to a function provided by the zsmooth plugin.
Methods:
-
__call__–Apply the selected clense mode to a clip using
Attributes:
-
BACKWARD–Use the current and previous two frames for temporal median filtering.
-
BOTH–Standard clense: median of previous, current, and next frame.
-
FORWARD–Use the current and next two frames for temporal median filtering.
-
NONE–No clense filtering. Returns the original clip unchanged.
BACKWARD class-attribute instance-attribute ¶
BACKWARD = 'BackwardClense'
Use the current and previous two frames for temporal median filtering.
BOTH class-attribute instance-attribute ¶
BOTH = 'Clense'
Standard clense: median of previous, current, and next frame.
FORWARD class-attribute instance-attribute ¶
FORWARD = 'ForwardClense'
Use the current and next two frames for temporal median filtering.
NONE class-attribute instance-attribute ¶
NONE = ''
No clense filtering. Returns the original clip unchanged.
__call__ ¶
__call__(
clip: VideoNode,
previous_clip: VideoNode | None = None,
next_clip: VideoNode | None = None,
planes: Planes = None,
) -> VideoNode
Apply the selected clense mode to a clip using the zsmooth plugin.
Parameters:
-
(clip¶VideoNode) –Source clip to process.
-
(previous_clip¶VideoNode | None, default:None) –Optional alternate clip to source previous frames. Defaults to
clip. -
(next_clip¶VideoNode | None, default:None) –Optional alternate clip to source next frames. Defaults to
clip. -
(planes¶Planes, default:None) –Planes to process. Defaults to all.
Returns:
-
VideoNode–Clensed clip with temporal median filtering.
Source code in vsrgtools/rgtools.py
522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 | |
__call__ ¶
__call__(*args: P.args, **kwargs: P.kwargs) -> R
Source code in vsrgtools/rgtools.py
488 489 | |
RemoveGrain ¶
RemoveGrain(repair_func: Callable[P, R])
Class decorator that wraps the remove_grain function and extends its functionality.
It is not meant to be used directly.
Classes:
-
Mode–Enum representing available spatial filtering strategies in RemoveGrain.
Methods:
-
__call__–
Source code in vsrgtools/rgtools.py
254 255 | |
Mode ¶
Bases: CustomIntEnum
Enum representing available spatial filtering strategies in RemoveGrain.
These modes serve a wide range of use cases, such as clamping outliers, removing noise, or simple dehaloing.
More information here.
Methods:
-
__call__–Apply the selected remove grain mode to a
clip.
Attributes:
-
BINOMIAL_BLUR–Deprecated. Use
BlurMatrix.BINOMIAL. Applies weighted 3x3 blur. -
BOB_BOTTOM_CLOSE–Interpolate bottom field using the closest neighboring pixels.
-
BOB_BOTTOM_INTER–Bottom field interpolation using a more complex formula than mode 14.
-
BOB_TOP_CLOSE–Interpolate top field using the closest neighboring pixels.
-
BOB_TOP_INTER–Top field interpolation using a more complex formula than mode 13.
-
BOX_BLUR–Alias for MEAN.
-
BOX_BLUR_NO_CENTER–Alias for MEAN_NO_CENTER.
-
EDGE_CLIP_LIGHT–Light edge clipping (prioritizes the range between opposites).
-
EDGE_CLIP_MEDIUM–Balanced version of mode 6 (change vs. range ratio 1:1).
-
EDGE_CLIP_MODERATE–Line-sensitive clipping with moderate sensitivity (change prioritized 2:1).
-
EDGE_CLIP_STRONG–Line-sensitive clipping that minimizes change to the center pixel.
-
EDGE_DEHALO–Very light dehaloing. Rarely useful.
-
EDGE_DEHALO2–More conservative version of mode 23.
-
LINE_CLIP_CLOSE–Clip using the line with closest neighbors. Useful for fixing 1-pixel gaps.
-
LINE_CLIP_OPP–Line-sensitive clipping using opposite neighbors with minimal deviation.
-
MEAN–Deprecated. Use
BlurMatrix.MEAN. Arithmetic mean of 3x3 neighborhood. -
MEAN_NO_CENTER–Deprecated. Use
BlurMatrix.MEAN_NO_CENTER. Mean of neighborhood (excluding center). -
MINMAX_AROUND1–Clamp pixel to the min/max of its 3x3 neighborhood (excluding center).
-
MINMAX_AROUND2–Clamp to the second lowest/highest in the neighborhood.
-
MINMAX_AROUND3–Clamp to the third lowest/highest in the neighborhood.
-
MINMAX_MEDIAN–Deprecated. Similar to mode 1, but clamps to fourth-lowest/highest.
-
MINMAX_MEDIAN_OPP–Clip using min/max of opposing neighbor pairs.
-
MIN_SHARP–Replaces pixel with its closest neighbor. A poor but sharp denoiser.
-
MIN_SHARP2–Minimal sharpening also known as "non destructive sharpen".
-
NONE–The input plane is simply passed through.
-
OPP_CLIP_AVG–Clip to min/max of averages of 4 opposing pixel pairs.
-
OPP_CLIP_AVG_FAST–Faster variant of mode 21 with simpler rounding.
-
SMART_RGC–Like mode 17, but preserves corners. Does not preserve thin lines.
-
SMART_RGCL–Uses 12 pixel pairs instead of 8. Similar to 26, but slightly stronger.
-
SMART_RGCL2–Variant of 27 with different pairs. Usually visually similar.
BINOMIAL_BLUR class-attribute instance-attribute ¶
BINOMIAL_BLUR = 11
Deprecated. Use BlurMatrix.BINOMIAL. Applies weighted 3x3 blur.
BOB_BOTTOM_CLOSE class-attribute instance-attribute ¶
BOB_BOTTOM_CLOSE = 14
Interpolate bottom field using the closest neighboring pixels.
BOB_BOTTOM_INTER class-attribute instance-attribute ¶
BOB_BOTTOM_INTER = 16
Bottom field interpolation using a more complex formula than mode 14.
BOB_TOP_CLOSE class-attribute instance-attribute ¶
BOB_TOP_CLOSE = 13
Interpolate top field using the closest neighboring pixels.
BOB_TOP_INTER class-attribute instance-attribute ¶
BOB_TOP_INTER = 15
Top field interpolation using a more complex formula than mode 13.
BOX_BLUR_NO_CENTER class-attribute instance-attribute ¶
BOX_BLUR_NO_CENTER = MEAN_NO_CENTER
Alias for MEAN_NO_CENTER.
EDGE_CLIP_LIGHT class-attribute instance-attribute ¶
EDGE_CLIP_LIGHT = 8
Light edge clipping (prioritizes the range between opposites).
EDGE_CLIP_MEDIUM class-attribute instance-attribute ¶
EDGE_CLIP_MEDIUM = 7
Balanced version of mode 6 (change vs. range ratio 1:1).
EDGE_CLIP_MODERATE class-attribute instance-attribute ¶
EDGE_CLIP_MODERATE = 6
Line-sensitive clipping with moderate sensitivity (change prioritized 2:1).
EDGE_CLIP_STRONG class-attribute instance-attribute ¶
EDGE_CLIP_STRONG = 5
Line-sensitive clipping that minimizes change to the center pixel.
EDGE_DEHALO class-attribute instance-attribute ¶
EDGE_DEHALO = 23
Very light dehaloing. Rarely useful.
EDGE_DEHALO2 class-attribute instance-attribute ¶
EDGE_DEHALO2 = 24
More conservative version of mode 23.
LINE_CLIP_CLOSE class-attribute instance-attribute ¶
LINE_CLIP_CLOSE = 9
Clip using the line with closest neighbors. Useful for fixing 1-pixel gaps.
LINE_CLIP_OPP class-attribute instance-attribute ¶
LINE_CLIP_OPP = 18
Line-sensitive clipping using opposite neighbors with minimal deviation.
MEAN class-attribute instance-attribute ¶
MEAN = 20
Deprecated. Use BlurMatrix.MEAN. Arithmetic mean of 3x3 neighborhood.
MEAN_NO_CENTER class-attribute instance-attribute ¶
MEAN_NO_CENTER = 19
Deprecated. Use BlurMatrix.MEAN_NO_CENTER. Mean of neighborhood (excluding center).
MINMAX_AROUND1 class-attribute instance-attribute ¶
MINMAX_AROUND1 = 1
Clamp pixel to the min/max of its 3x3 neighborhood (excluding center).
MINMAX_AROUND2 class-attribute instance-attribute ¶
MINMAX_AROUND2 = 2
Clamp to the second lowest/highest in the neighborhood.
MINMAX_AROUND3 class-attribute instance-attribute ¶
MINMAX_AROUND3 = 3
Clamp to the third lowest/highest in the neighborhood.
MINMAX_MEDIAN class-attribute instance-attribute ¶
MINMAX_MEDIAN = 4
Deprecated. Similar to mode 1, but clamps to fourth-lowest/highest.
MINMAX_MEDIAN_OPP class-attribute instance-attribute ¶
MINMAX_MEDIAN_OPP = 17
Clip using min/max of opposing neighbor pairs.
MIN_SHARP class-attribute instance-attribute ¶
MIN_SHARP = 10
Replaces pixel with its closest neighbor. A poor but sharp denoiser.
MIN_SHARP2 class-attribute instance-attribute ¶
MIN_SHARP2 = 25
Minimal sharpening also known as "non destructive sharpen".
OPP_CLIP_AVG class-attribute instance-attribute ¶
OPP_CLIP_AVG = 21
Clip to min/max of averages of 4 opposing pixel pairs.
OPP_CLIP_AVG_FAST class-attribute instance-attribute ¶
OPP_CLIP_AVG_FAST = 22
Faster variant of mode 21 with simpler rounding.
SMART_RGC class-attribute instance-attribute ¶
SMART_RGC = 26
Like mode 17, but preserves corners. Does not preserve thin lines.
SMART_RGCL class-attribute instance-attribute ¶
SMART_RGCL = 27
Uses 12 pixel pairs instead of 8. Similar to 26, but slightly stronger.
SMART_RGCL2 class-attribute instance-attribute ¶
SMART_RGCL2 = 28
Variant of 27 with different pairs. Usually visually similar.
__call__ ¶
Apply the selected remove grain mode to a clip.
Parameters:
-
(clip¶VideoNode) –Clip to process.
-
(planes¶Planes, default:None) –Planes to process. Defaults to all.
Returns:
-
VideoNode–Processed (denoised) clip.
Source code in vsrgtools/rgtools.py
420 421 422 423 424 425 426 427 428 429 430 431 | |
__call__ ¶
__call__(*args: P.args, **kwargs: P.kwargs) -> R
Source code in vsrgtools/rgtools.py
257 258 | |
Repair ¶
Repair(repair_func: Callable[P, R])
Class decorator that wraps the repair function and extends its functionality.
It is not meant to be used directly.
Classes:
-
Mode–Enum that specifies the mode for repairing or limiting a source clip using a reference clip.
Methods:
-
__call__–
Source code in vsrgtools/rgtools.py
23 24 | |
Mode ¶
Bases: CustomIntEnum
Enum that specifies the mode for repairing or limiting a source clip using a reference clip.
These modes define different spatial strategies for constraining each pixel in the source clip based on the reference clip's local neighborhood, typically using 3x3 squares or line-sensitive patterns.
Commonly used in denoising, artifact removal, or detail-preserving restoration.
Methods:
-
__call__–Apply the selected repair mode to a
clipusing arepairclip.
Attributes:
-
CLIP_REF_RG17–Use RemoveGrain mode 17's result to constrain the pixel.
-
CLIP_REF_RG18–Use RemoveGrain mode 18's result to constrain the pixel.
-
CLIP_REF_RG19–Use RemoveGrain mode 19's result to constrain the pixel.
-
CLIP_REF_RG20–Use RemoveGrain mode 20's result to constrain the pixel.
-
CLIP_REF_RG21–Use RemoveGrain mode 21's result to constrain the pixel.
-
CLIP_REF_RG22–Use RemoveGrain mode 22's result to constrain the pixel.
-
CLIP_REF_RG23–Use RemoveGrain mode 23's result to constrain the pixel.
-
CLIP_REF_RG24–Use RemoveGrain mode 24's result to constrain the pixel.
-
CLIP_REF_RG26–Use RemoveGrain mode 26's result to constrain the pixel.
-
CLIP_REF_RG27–Use RemoveGrain mode 27's result to constrain the pixel.
-
CLIP_REF_RG28–Use RemoveGrain mode 28's result to constrain the pixel.
-
CLIP_REF_RG5–Use RemoveGrain mode 5's result to constrain the pixel.
-
CLIP_REF_RG6–Use RemoveGrain mode 6's result to constrain the pixel.
-
LINE_CLIP_CLOSE–Line-sensitive clamp using the closest neighbors.
-
LINE_CLIP_LIGHT–Line-sensitive clamping with a light effect.
-
LINE_CLIP_MEDIUM–Line-sensitive clamping with a moderate effect.
-
LINE_CLIP_MIN–Line-sensitive clamping with minimal alteration.
-
LINE_CLIP_STRONG–Line-sensitive clamping with a strong effect.
-
MINMAX_SQUARE1–Clamp using the 1st min/max from a 3x3 square in the reference clip.
-
MINMAX_SQUARE2–Clamp using the 2nd min/max from a 3x3 square in the reference clip.
-
MINMAX_SQUARE3–Clamp using the 3rd min/max from a 3x3 square in the reference clip.
-
MINMAX_SQUARE4–Clamp using the 4th min/max from a 3x3 square in the reference clip.
-
MINMAX_SQUARE_REF1–Same as mode 1, but clips with min/max of 1st rank and the center pixel of the reference clip.
-
MINMAX_SQUARE_REF2–Same as mode 2, but clips with min/max of 2nd rank and the center pixel of the reference clip.
-
MINMAX_SQUARE_REF3–Same as mode 3, but clips with min/max of 3rd rank and the center pixel of the reference clip.
-
MINMAX_SQUARE_REF4–Same as mode 4, but clips with min/max of 4th rank and the center pixel of the reference clip.
-
MINMAX_SQUARE_REF_CLOSE–Replace pixel with the closest value in the 3x3 reference square.
-
NONE–No repair. The input plane is passed through unchanged.
CLIP_REF_RG17 class-attribute instance-attribute ¶
CLIP_REF_RG17 = 17
Use RemoveGrain mode 17's result to constrain the pixel.
CLIP_REF_RG18 class-attribute instance-attribute ¶
CLIP_REF_RG18 = 18
Use RemoveGrain mode 18's result to constrain the pixel.
CLIP_REF_RG19 class-attribute instance-attribute ¶
CLIP_REF_RG19 = 19
Use RemoveGrain mode 19's result to constrain the pixel.
CLIP_REF_RG20 class-attribute instance-attribute ¶
CLIP_REF_RG20 = 20
Use RemoveGrain mode 20's result to constrain the pixel.
CLIP_REF_RG21 class-attribute instance-attribute ¶
CLIP_REF_RG21 = 21
Use RemoveGrain mode 21's result to constrain the pixel.
CLIP_REF_RG22 class-attribute instance-attribute ¶
CLIP_REF_RG22 = 22
Use RemoveGrain mode 22's result to constrain the pixel.
CLIP_REF_RG23 class-attribute instance-attribute ¶
CLIP_REF_RG23 = 23
Use RemoveGrain mode 23's result to constrain the pixel.
CLIP_REF_RG24 class-attribute instance-attribute ¶
CLIP_REF_RG24 = 24
Use RemoveGrain mode 24's result to constrain the pixel.
CLIP_REF_RG26 class-attribute instance-attribute ¶
CLIP_REF_RG26 = 26
Use RemoveGrain mode 26's result to constrain the pixel.
CLIP_REF_RG27 class-attribute instance-attribute ¶
CLIP_REF_RG27 = 27
Use RemoveGrain mode 27's result to constrain the pixel.
CLIP_REF_RG28 class-attribute instance-attribute ¶
CLIP_REF_RG28 = 28
Use RemoveGrain mode 28's result to constrain the pixel.
CLIP_REF_RG5 class-attribute instance-attribute ¶
CLIP_REF_RG5 = 15
Use RemoveGrain mode 5's result to constrain the pixel.
CLIP_REF_RG6 class-attribute instance-attribute ¶
CLIP_REF_RG6 = 16
Use RemoveGrain mode 6's result to constrain the pixel.
LINE_CLIP_CLOSE class-attribute instance-attribute ¶
LINE_CLIP_CLOSE = 9
Line-sensitive clamp using the closest neighbors.
LINE_CLIP_LIGHT class-attribute instance-attribute ¶
LINE_CLIP_LIGHT = 6
Line-sensitive clamping with a light effect.
LINE_CLIP_MEDIUM class-attribute instance-attribute ¶
LINE_CLIP_MEDIUM = 7
Line-sensitive clamping with a moderate effect.
LINE_CLIP_MIN class-attribute instance-attribute ¶
LINE_CLIP_MIN = 5
Line-sensitive clamping with minimal alteration.
LINE_CLIP_STRONG class-attribute instance-attribute ¶
LINE_CLIP_STRONG = 8
Line-sensitive clamping with a strong effect.
MINMAX_SQUARE1 class-attribute instance-attribute ¶
MINMAX_SQUARE1 = 1
Clamp using the 1st min/max from a 3x3 square in the reference clip.
MINMAX_SQUARE2 class-attribute instance-attribute ¶
MINMAX_SQUARE2 = 2
Clamp using the 2nd min/max from a 3x3 square in the reference clip.
MINMAX_SQUARE3 class-attribute instance-attribute ¶
MINMAX_SQUARE3 = 3
Clamp using the 3rd min/max from a 3x3 square in the reference clip.
MINMAX_SQUARE4 class-attribute instance-attribute ¶
MINMAX_SQUARE4 = 4
Clamp using the 4th min/max from a 3x3 square in the reference clip.
MINMAX_SQUARE_REF1 class-attribute instance-attribute ¶
MINMAX_SQUARE_REF1 = 11
Same as mode 1, but clips with min/max of 1st rank and the center pixel of the reference clip.
MINMAX_SQUARE_REF2 class-attribute instance-attribute ¶
MINMAX_SQUARE_REF2 = 12
Same as mode 2, but clips with min/max of 2nd rank and the center pixel of the reference clip.
MINMAX_SQUARE_REF3 class-attribute instance-attribute ¶
MINMAX_SQUARE_REF3 = 13
Same as mode 3, but clips with min/max of 3rd rank and the center pixel of the reference clip.
MINMAX_SQUARE_REF4 class-attribute instance-attribute ¶
MINMAX_SQUARE_REF4 = 14
Same as mode 4, but clips with min/max of 4th rank and the center pixel of the reference clip.
MINMAX_SQUARE_REF_CLOSE class-attribute instance-attribute ¶
MINMAX_SQUARE_REF_CLOSE = 10
Replace pixel with the closest value in the 3x3 reference square.
NONE class-attribute instance-attribute ¶
NONE = 0
No repair. The input plane is passed through unchanged.
__call__ ¶
__call__(
clip: VideoNode, repairclip: VideoNode, planes: Planes = None
) -> VideoNode
Apply the selected repair mode to a clip using a repairclip.
Parameters:
-
(clip¶VideoNode) –Input clip to process (typically filtered).
-
(repairclip¶VideoNode) –Reference clip for bounds (often the original or a less-processed version).
-
(planes¶Planes, default:None) –Planes to process. Defaults to all.
Returns:
-
VideoNode–Clip with repaired pixels, bounded by the reference.
Source code in vsrgtools/rgtools.py
181 182 183 184 185 186 187 188 189 190 191 192 193 | |
__call__ ¶
__call__(*args: P.args, **kwargs: P.kwargs) -> R
Source code in vsrgtools/rgtools.py
26 27 | |
VerticalCleaner ¶
VerticalCleaner(vertical_cleaner_func: Callable[P, R])
Class decorator that wraps the vertical_cleaner function and extends its functionality.
It is not meant to be used directly.
Classes:
-
Mode–Enum that specifies the vertical cleaner mode to use
Methods:
-
__call__–
Source code in vsrgtools/rgtools.py
593 594 | |
Mode ¶
Bases: CustomIntEnum
Enum that specifies the vertical cleaner mode to use in the zsmooth plugin.
Methods:
-
__call__–Applies the vertical cleaning mode to the given clip.
Attributes:
-
MEDIAN–Applies a strict vertical median filter.
-
NONE–The input plane is simply passed through.
-
PRESERVING–Applies a detail-preserving vertical median filter (less aggressive).
PRESERVING class-attribute instance-attribute ¶
PRESERVING = 2
Applies a detail-preserving vertical median filter (less aggressive).
__call__ ¶
Applies the vertical cleaning mode to the given clip.
Parameters:
-
(clip¶VideoNode) –Source clip to process.
-
(planes¶Planes, default:None) –Planes to process. Defaults to all.
Returns:
-
VideoNode–Filtered clip.
Source code in vsrgtools/rgtools.py
620 621 622 623 624 625 626 627 628 629 630 631 | |
__call__ ¶
__call__(*args: P.args, **kwargs: P.kwargs) -> R
Source code in vsrgtools/rgtools.py
596 597 | |
clense ¶
clense(
clip: VideoNode,
previous_clip: VideoNode | None = None,
next_clip: VideoNode | None = None,
mode: Mode | str = NONE,
planes: Planes = None,
) -> VideoNode
Apply a clense (temporal median) filter based on the specified mode.
Example
clensed = clense(clip, ..., mode=clense.Mode.BOTH)
Alternatively, directly using the enum:
clensed = clense.Mode.BOTH(clip, ...)
Parameters:
-
(clip¶VideoNode) –Source clip to process.
-
(previous_clip¶VideoNode | None, default:None) –Optional alternate clip to source previous frames. Defaults to
clip. -
(next_clip¶VideoNode | None, default:None) –Optional alternate clip to source next frames. Defaults to
clip. -
(mode¶Mode | str, default:NONE) –Mode of filtering. One of Mode or its string values.
-
(planes¶Planes, default:None) –Planes to process. Defaults to all.
Returns:
-
VideoNode–Clensed clip with temporal median filtering.
Source code in vsrgtools/rgtools.py
546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 | |
remove_grain ¶
remove_grain(
clip: VideoNode,
mode: int | Mode | Sequence[int | Mode],
planes: Planes = None,
) -> VideoNode
Apply spatial denoising using the RemoveGrain algorithm.
Supports a variety of pixel clamping, edge-aware filtering, and blur strategies. See RemoveGrain.Mode for all available modes.
- Modes 1-24 are natively implemented in zsmooth.RemoveGrain.
- Modes 25+ fall back to expression-based implementations.
Example
denoised = remove_grain(clip, remove_grain.Mode.EDGE_CLIP_STRONG)
Alternatively, directly using the enum:
denoised = remove_grain.Mode.EDGE_CLIP_STRONG(clip)
Parameters:
-
(clip¶VideoNode) –Clip to process.
-
(mode¶int | Mode | Sequence[int | Mode]) –Mode(s) to use. Can be a single mode or per-plane list. See RemoveGrain.Mode for details.
-
(planes¶Planes, default:None) –Planes to process. Default to all.
Returns:
-
VideoNode–Processed (denoised) clip.
Source code in vsrgtools/rgtools.py
434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 | |
repair ¶
repair(
clip: VideoNode,
repairclip: VideoNode,
mode: int | Mode | Sequence[int | Mode],
planes: Planes = None,
) -> VideoNode
Constrains the input clip using a repairclip by clamping pixel values based on a chosen mode.
This is typically used to limit over-aggressive filtering (e.g., from RemoveGrain) while keeping the corrections within reasonable bounds derived from the reference (repairclip). Often used in detail restoration workflows.
- Modes 1-24 directly map to zsmooth.Repair plugin modes.
- Modes 26+ fall back to expression-based implementations.
Example
repaired = repair(filtered, clip, repair.Mode.MINMAX_SQUARE_REF3)
Alternatively, directly using the enum:
repaired = repair.Mode.MINMAX_SQUARE_REF3(clip)
Parameters:
-
(clip¶VideoNode) –Input clip to process (typically filtered).
-
(repairclip¶VideoNode) –Reference clip for bounds (often the original or a less-processed version).
-
(mode¶int | Mode | Sequence[int | Mode]) –Repair mode(s) used to constrain pixels. Can be a single mode or a list per plane. See Repair.Mode for details.
-
(planes¶Planes, default:None) –Planes to process. Default to all.
Returns:
-
VideoNode–Clip with repaired pixels, bounded by the reference.
Source code in vsrgtools/rgtools.py
196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 | |
vertical_cleaner ¶
vertical_cleaner(
clip: VideoNode,
mode: int | Mode | Sequence[int | Mode],
planes: Planes = None,
) -> VideoNode
Applies a fast vertical median or relaxed median filter to the clip using the zsmooth plugin.
Example
cleaned = vertical_cleaner(clip, vertical_cleaner.Mode.PRESERVING)
Alternatively, directly using the enum:
cleaned = vertical_cleaner.Mode.PRESERVING(clip)
Parameters:
-
(clip¶VideoNode) –Source clip to process.
-
(mode¶int | Mode | Sequence[int | Mode]) –Mode of vertical cleaning to apply. Can be:
- A single enum/int (applied to all planes),
- A sequence of enums/ints (one per plane).
-
(planes¶Planes, default:None) –Planes to process. Defaults to all.
Returns:
-
VideoNode–Filtered clip.
Source code in vsrgtools/rgtools.py
634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 | |