border ¶
This module implements utilities for correcting dirty or damaged borders.
Classes:
-
FixBorderBrightness–Utility class to adjust or correct brightness inconsistencies along clip borders.
FixBorderBrightness ¶
FixBorderBrightness(
clip: VideoNode,
protect: bool | tuple[float, float] | list[tuple[float, float]] = True,
)
Bases: VSObject
Utility class to adjust or correct brightness inconsistencies along clip borders.
Example
# The following example darkens the top and right borders slightly (0.9x)
# to reduce edge brightness inconsistencies, then applies the correction.
fbb = FixBorderBrightness(clip)
fbb.fix_row(-2, 0.9) # Adjust brightness near the bottom edge
fbb.fix_row(1, 0.9) # Adjust brightness near the top edge
fbb.fix_column(1, 0.9) # Adjust brightness near the left edge
fbb.fix_column(-2, 0.9) # Adjust brightness near the right edge
out = fbb.process() # Apply all configured border corrections
Initializes the class.
Parameters:
-
(clip¶VideoNode) –Input clip.
-
(protect¶bool | tuple[float, float] | list[tuple[float, float]], default:True) –Protection configuration for pixel intensity ranges.
- If
True, automatically determines safe low/high protection thresholds per plane using the clip's minimum and maximum allowed pixel values. - If
False, disables protection (no clipping protection is applied). - If a tuple
(low, high)is given, applies it as a protection range. - If a list of tuples is provided, applies individual protection ranges per plane.
- If
Methods:
-
fix_column–Apply a correction multiplier to an entire column in a specific plane.
-
fix_row–Apply a correction multiplier to an entire row in a specific plane.
-
process–Apply all configured border corrections to the clip.
Attributes:
-
clip–
Source code in vsdehalo/border.py
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | |
fix_column ¶
Apply a correction multiplier to an entire column in a specific plane.
Parameters:
-
(num¶int) –Column index to correct.
-
(value¶float) –Correction value.
-
(plane_index¶int, default:0) –Plane index to apply the correction to (default is 0).
Source code in vsdehalo/border.py
233 234 235 236 237 238 239 240 241 242 | |
fix_row ¶
Apply a correction multiplier to an entire row in a specific plane.
Parameters:
-
(num¶int) –Row index to correct.
-
(value¶float) –Correction value.
-
(plane_index¶int, default:0) –Plane index to apply the correction to (default is 0).
Source code in vsdehalo/border.py
244 245 246 247 248 249 250 251 252 253 | |
process ¶
Apply all configured border corrections to the clip.
Parameters:
-
(**kwargs¶Any, default:{}) –Additional arguments forwarded to vsexprtools.norm_expr.
Returns:
-
VideoNode–A new clip with fixed borders applied.
Source code in vsdehalo/border.py
255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 | |