sharp ¶
Functions:
-
awarpsharp
–Sharpens edges by warping them.
-
fine_sharp
– -
soothe
– -
unsharpen
–Apply an unsharp mask to a clip.
awarpsharp ¶
awarpsharp(
clip: VideoNode,
mask: EdgeDetectLike | VideoNode | None = None,
thresh: int | float = 128,
blur: int | GenericVSFunction[VideoNode] | Literal[False] = 3,
depth: int | Sequence[int] | None = None,
chroma: bool = False,
planes: Planes = None,
) -> ConstantFormatVideoNode
Sharpens edges by warping them.
Parameters:
-
clip
¶VideoNode
) –Clip to process. Must be either the same size as mask, or four times the size of mask in each dimension. The latter can be useful if better subpixel interpolation is desired. If clip is upscaled to four times the original size, it must be top-left aligned.
-
mask
¶EdgeDetectLike | VideoNode | None
, default:None
) –Edge mask.
-
thresh
¶int | float
, default:128
) –No pixel in the edge mask will have a value greater than thresh. Decrease for weaker sharpening.
-
blur
¶int | GenericVSFunction[VideoNode] | Literal[False]
, default:3
) –Specifies the blur applied to the edge mask. - If an
int
, it sets the number of passes for the defaultbox_blur
filter. - If a callable, a custom blur function will be used instead. - IfFalse
, no blur will be applied. -
depth
¶int | Sequence[int] | None
, default:None
) –Controls how far to warp. Negative values warp in the other direction, i.e. will blur the image instead of sharpening.
-
chroma
¶bool
, default:False
) –Controls the chroma handling method. False will use the edge mask from the luma to warp the chroma. True will create an edge mask from each chroma channel and use those to warp each chroma channel individually.
-
planes
¶Planes
, default:None
) –Planes to process. Defaults to all.
Returns:
-
ConstantFormatVideoNode
–Warp-sharpened clip.
Source code in vsrgtools/sharp.py
76 77 78 79 80 81 82 83 84 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 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 |
|
fine_sharp ¶
fine_sharp(
clip: VideoNode,
mode: int = 0,
sstr: float = 2.0,
cstr: float | None = None,
xstr: float = 0.19,
lstr: float = 1.49,
pstr: float = 1.272,
ldmp: float | None = None,
hdmp: float = 0.01,
planes: Planes = 0,
) -> ConstantFormatVideoNode
Source code in vsrgtools/sharp.py
141 142 143 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 187 188 189 190 191 192 193 194 195 196 197 198 199 |
|
soothe ¶
soothe(
flt: VideoNode,
src: VideoNode,
spatial_strength: float = 0.0,
temporal_strength: float = 0.75,
spatial_radius: int = 1,
temporal_radius: int = 1,
scenechange: bool = False,
planes: Planes = None,
) -> ConstantFormatVideoNode
Source code in vsrgtools/sharp.py
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 |
|
unsharpen ¶
unsharpen(
clip: VideoNode,
strength: float = 1.0,
blur: (
VideoNode | VSFunctionNoArgs[VideoNode, ConstantFormatVideoNode]
) = partial(gauss_blur, sigma=1.5),
planes: Planes = None,
func: FuncExcept | None = None,
) -> ConstantFormatVideoNode
Apply an unsharp mask to a clip.
This filter sharpens the input by subtracting a blurred version of the clip from the original, scaling the difference by the given strength
, and adding it back to the original image. Conceptually:
result = clip + (clip - blur(clip)) * strength
Parameters:
-
clip
¶VideoNode
) –Input clip.
-
strength
¶float
, default:1.0
) –Sharpening strength. Defaults to 1.0.
-
blur
¶VideoNode | VSFunctionNoArgs[VideoNode, ConstantFormatVideoNode]
, default:partial(gauss_blur, sigma=1.5)
) –Either a blurred reference clip or a callable that takes the source clip and returns a blurred version (e.g., a Gaussian blur).
-
planes
¶Planes
, default:None
) –Which planest to process. Default to all.
-
func
¶FuncExcept | None
, default:None
) –func: Function returned for custom error handling. This should only be set by VS package developers.
Returns:
-
ConstantFormatVideoNode
–A sharpened clip.
Source code in vsrgtools/sharp.py
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
|