vodesfunc.noise
ntype4
module-attribute
vodesfunc grainer type 4 preset
itype4
module-attribute
itype4 = {'type': 2, 'size': 0.769, 'sharp': Bicubic(b=-1 / 2, c=1 / 4), 'protect_chroma': True, 'fade_limits': True}
Also the vodesfunc type 4 preset but 'should' work for vsdeband grainers.
adaptive_grain
adaptive_grain(clip: VideoNode, strength: float | list[float] = [2.0, 0.5], size: float | list[float] = 3, type: int = 3, static: bool = False, temporal_average: int = 25, luma_scaling: float = 6, seed: int = -1, temporal_radius: int = 3, scale: float = 1, scaler: Scaler = Lanczos(), post_grain: Callable[[VideoNode], VideoNode] | None = None, fade_edges: bool = True, tv_range: bool = True, lo: int | Sequence[int] | None = None, hi: int | Sequence[int] | None = None, protect_neutral: bool = True, **kwargs) -> vs.VideoNode
Very frankenstein'd mix of setsu's and the original adptvgrnMod Only supports https://github.com/wwww-wwww/vs-noise and has some stuff I don't need stripped out.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
clip
|
VideoNode
|
Input clip. |
required |
strength
|
float | list[float]
|
Grainer strength. Use a list to specify [luma, chroma] graining. Default chroma grain is luma / 5. |
[2.0, 0.5]
|
size
|
float | list[float]
|
Grain size. Will be passed as xsize and ysize. Can be adjusted individually with a list.
This should not be confused with the resizing of adptvgrnMod. For something similar, use the |
3
|
type
|
int
|
See vs-noise github for 0-4. |
3
|
static
|
bool
|
Static or dynamic grain. |
False
|
seed
|
int
|
Grain seed for the grainer. |
-1
|
temporal_average
|
int
|
Reference frame weighting for temporal softening and grain consistency. |
25
|
temporal_radius
|
int
|
How many frames the averaging will use. |
3
|
luma_scaling
|
float
|
Luma scaling passed to the adaptivegrain mask. While use the absolute value on an inverted clip if a negative number is passed. Mainly useful for graining the bright parts of an image. |
6
|
scale
|
float
|
Makes the grain bigger if > 1 and smaller if < 1 by graining a different sized blankclip and scaling to clip res after. Can be used to tweak sharpness/frequency considering vs-noise always keeps those the same no matter the size. |
1
|
scaler
|
Scaler
|
Scaler/Kernel used for down- or upscaling the grained blankclip. |
Lanczos()
|
post_grain
|
Callable[[VideoNode], VideoNode] | None
|
A callable function to run on the grained blankclip pre scaling. An example use would be to sharpen like I did for something. |
None
|
fade_edges
|
bool
|
Keeps grain from exceeding legal range. With this, values whiclip.height go towards the neutral point, but would generate illegal values if they pointed in the other direction are also limited. This is better at maintaining average values and prevents flickering pixels on OLEDs. |
True
|
tv_range
|
bool
|
TV or PC legal range. |
True
|
lo
|
int | Sequence[int] | None
|
Overwrite legal range's minimums. Value is scaled from 8-bit to clip depth. |
None
|
hi
|
int | Sequence[int] | None
|
Overwrite legal range's maximums. Value is scaled from 8-bit to clip depth. |
None
|
protect_neutral
|
bool
|
Disable chroma grain on neutral chroma. |
True
|
kwargs
|
Kwargs passed to the grainer. |
{}
|
Returns:
| Type | Description |
|---|---|
VideoNode
|
Grained clip. |
Source code in
vodesfunc/noise.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 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 74 75 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 139 140 141 142 143 144 145 146 | |