placebo ¶
Classes:
-
Placebo
–Debander wrapper around libplacebo plugin's Deband function.
-
PlaceboDither
–
Placebo dataclass
¶
Placebo(
radius: float | None = None,
thr: float | list[float] | None = None,
grain: float | list[float] | None = None,
iterations: int | None = None,
dither: PlaceboDither | None = None,
)
Bases: Debander
Debander wrapper around libplacebo plugin's Deband function.
Methods:
-
deband
–Main deband function, wrapper for
placebo.Deband <https:/github.com/Lypheo/vs-placebo#vs-placebo>
_
Attributes:
-
dither
(PlaceboDither | None
) – -
grain
(float | list[float] | None
) – -
iterations
(int | None
) – -
radius
(float | None
) – -
thr
(float | list[float] | None
) –
deband ¶
deband(
clip: VideoNode,
radius: float = 16.0,
thr: float | list[float] = 3.0,
iterations: int = 4,
grain: float | list[float] = 0.0,
dither: PlaceboDither = DEFAULT,
) -> VideoNode
Main deband function, wrapper for placebo.Deband <https:/github.com/Lypheo/vs-placebo#vs-placebo>
_
Parameters:
-
clip
¶VideoNode
) –Source clip
-
radius
¶float
, default:16.0
) –The debanding filter's initial radius. The radius increases linearly for each iteration. A higher radius will find more gradients, but a lower radius will smooth more aggressively.
-
thr
¶float | list[float]
, default:3.0
) –The debanding filter's cut-off threshold. Higher numbers increase the debanding strength dramatically, but progressively diminish image details.
-
iterations
¶int
, default:4
) –The number of debanding steps to perform per sample. Each step reduces a bit more banding, but takes time to compute. Note that the strength of each step falls off very quickly, so high numbers (> 4) are practically useless.
-
grain
¶float | list[float]
, default:0.0
) –Add some extra noise to the image. This significantly helps cover up remaining quantization artifacts. Higher numbers add more noise. Note: When debanding HDR sources, even a small amount of grain can result in a very big change to the brightness level. It's recommended to either scale this value down or disable it entirely for HDR.
-
dither
¶PlaceboDither
, default:DEFAULT
) –Specify what kind of Placebo dithering will be used.
Returns:
-
VideoNode
–Debanded clip
Source code
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 |
|
PlaceboDither ¶
Bases: CustomIntEnum
Attributes:
-
BLUE_NOISE
–Dither with blue noise. Very high quality, but requires the use of a
-
DEFAULT
– -
NONE
–No dithering.
-
ORDERED_FIXED
–The same as
ORDERED_LUT
, but uses fixed function math instead -
ORDERED_LUT
–Dither with an ordered (bayer) dither matrix, using a LUT. Low quality,
-
WHITE_NOISE
–Dither with white noise. This does not require a LUT and is fairly cheap
-
placebo_args
(KwargsT
) –Get arguments you must pass to .placebo.Debander for this dither mode.
BLUE_NOISE class-attribute
instance-attribute
¶
BLUE_NOISE = 0
Dither with blue noise. Very high quality, but requires the use of a LUT. Warning: Computing a blue noise texture with a large size can be very slow, however this only needs to be performed once. Even so, using this with a lut_size
greater than 6 is generally ill-advised. This is the preferred/default dither method.
ORDERED_FIXED class-attribute
instance-attribute
¶
ORDERED_FIXED = 2
The same as ORDERED_LUT
, but uses fixed function math instead of a LUT. This is faster, but only supports a fixed dither matrix size of 16x16 (equal to a lut_size
of 4). Requires GLSL 130+.
ORDERED_LUT class-attribute
instance-attribute
¶
ORDERED_LUT = 1
Dither with an ordered (bayer) dither matrix, using a LUT. Low quality, and since this also uses a LUT, there's generally no advantage to picking this instead of BLUE_NOISE
. It's mainly there for testing.
WHITE_NOISE class-attribute
instance-attribute
¶
WHITE_NOISE = 3
Dither with white noise. This does not require a LUT and is fairly cheap to compute. Unlike the other modes it doesn't show any repeating patterns either spatially or temporally, but the downside is that this is visually fairly jarring due to the presence of low frequencies in the noise spectrum. Used as a fallback when the above methods are not available.
placebo_args property
¶
placebo_args: KwargsT
Get arguments you must pass to .placebo.Debander for this dither mode.