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
clip
using arepairclip
by 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])
Bases: Generic[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
365 366 |
|
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: PlanesT = None,
) -> ConstantFormatVideoNode
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
¶PlanesT
, default:None
) –Planes to process. Defaults to all.
Returns:
-
ConstantFormatVideoNode
–Clensed clip with temporal median filtering.
Source code
393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 |
|
__call__ ¶
__call__(*args: args, **kwargs: kwargs) -> R
Source code
368 369 |
|
RemoveGrain ¶
RemoveGrain(repair_func: Callable[P, R])
Bases: Generic[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
197 198 |
|
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 3×3 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 3×3 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 3×3 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 3×3 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 3×3 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 3×3 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
¶PlanesT
, default:None
) –Planes to process. Defaults to all.
Returns:
-
ConstantFormatVideoNode
–Processed (denoised) clip.
Source code
303 304 305 306 307 308 309 310 311 312 313 |
|
__call__ ¶
__call__(*args: args, **kwargs: kwargs) -> R
Source code
200 201 |
|
Repair ¶
Repair(repair_func: Callable[P, R])
Bases: Generic[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
26 27 |
|
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 3×3 squares or line-sensitive patterns.
Commonly used in denoising, artifact removal, or detail-preserving restoration.
Methods:
-
__call__
–Apply the selected repair mode to a
clip
using 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 3×3 square in the reference clip.
-
MINMAX_SQUARE2
–Clamp using the 2nd min/max from a 3×3 square in the reference clip.
-
MINMAX_SQUARE3
–Clamp using the 3rd min/max from a 3×3 square in the reference clip.
-
MINMAX_SQUARE4
–Clamp using the 4th min/max from a 3×3 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 3×3 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 3×3 square in the reference clip.
MINMAX_SQUARE2 class-attribute
instance-attribute
¶
MINMAX_SQUARE2 = 2
Clamp using the 2nd min/max from a 3×3 square in the reference clip.
MINMAX_SQUARE3 class-attribute
instance-attribute
¶
MINMAX_SQUARE3 = 3
Clamp using the 3rd min/max from a 3×3 square in the reference clip.
MINMAX_SQUARE4 class-attribute
instance-attribute
¶
MINMAX_SQUARE4 = 4
Clamp using the 4th min/max from a 3×3 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 3×3 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: PlanesT = None
) -> ConstantFormatVideoNode
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
¶PlanesT
, default:None
) –Planes to process. Defaults to all.
Returns:
-
ConstantFormatVideoNode
–Clip with repaired pixels, bounded by the reference.
Source code
128 129 130 131 132 133 134 135 136 137 138 139 140 141 |
|
__call__ ¶
__call__(*args: args, **kwargs: kwargs) -> R
Source code
29 30 |
|
VerticalCleaner ¶
VerticalCleaner(vertical_cleaner_func: Callable[P, R])
Bases: Generic[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
459 460 |
|
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
¶PlanesT
, default:None
) –Planes to process. Defaults to all.
Returns:
-
ConstantFormatVideoNode
–Filtered clip.
Source code
480 481 482 483 484 485 486 487 488 489 |
|
__call__ ¶
__call__(*args: args, **kwargs: kwargs) -> R
Source code
462 463 |
|
clense ¶
clense(
clip: VideoNode,
previous_clip: VideoNode | None = None,
next_clip: VideoNode | None = None,
mode: Mode | str = NONE,
planes: PlanesT = None,
) -> ConstantFormatVideoNode
Apply a clense (temporal median) filter based on the specified mode.
Example:
clensed = clense(clip, ..., mode=clense.Mode.BOTH)
Alternatively, directly using the enum:
```py
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
¶PlanesT
, default:None
) –Planes to process. Defaults to all.
Returns:
-
ConstantFormatVideoNode
–Clensed clip with temporal median filtering.
Source code
413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 |
|
remove_grain ¶
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:
```py
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.
Returns:
-
ConstantFormatVideoNode
–Processed (denoised) clip.
Source code
316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 |
|
repair ¶
repair(
clip: VideoNode,
repairclip: VideoNode,
mode: int | Mode | Sequence[int | Mode],
) -> ConstantFormatVideoNode
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:
```py
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.
Returns:
-
ConstantFormatVideoNode
–Clip with repaired pixels, bounded by the reference.
Source code
144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 |
|
vertical_cleaner ¶
vertical_cleaner(
clip: VideoNode, mode: int | Mode | Sequence[int | Mode]
) -> ConstantFormatVideoNode
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:
```py
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).
Returns:
-
ConstantFormatVideoNode
–Filtered clip.
Source code
492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 |
|