Parts of this sub-module will soon be deprecated in favor of vapoursynth-denoise!

lvsfunc.noise.bm3d(clip[, sigma, radius, ...])

BM3D denoising filter using the CPU.

lvsfunc.noise.chickendream(clip[, sigma, ...])

Realistic film grain generator.

This sub-module is aliased as denoise for backwards compatibility.

lvsfunc.noise.bm3d(clip, sigma=0.75, radius=None, ref=None, pre=None, refine=1, matrix_s='709', basic_args={}, final_args={})

BM3D denoising filter using the CPU.


This function has been deprecated! It will be removed in a future commit.


  • clip (vs.VideoNode) – Clip to process.

  • sigma (float | list[float]) – Denoising strength for both basic and final estimations.

  • radius (int | list[int] | None) – Temporal radius for both basic and final estimations.

  • ref (vs.VideoNode | None) – Reference clip for the final estimation.

  • pre (vs.VideoNode | None) – Prefiltered clip for the basic estimation.

  • refine (int) – Iteration of the final clip. 0 = basic estimation only 1 = basic + final estimation n = basic + n final estimations

  • matrix_s (str) – Color matrix of the Clip to process.

  • basic_args (dict[str, Any]) – Args to pass to the basic estimation.

  • final_args (dict[str, Any]) – Args to pass to the final estimation.

Return type



Denoised clip.

  • ValueError – Invalid number of sigma parameters were passed.

  • ValueError – Invalid number of radii parameters were passed.

lvsfunc.noise.chickendream(clip, sigma=0.35, rad=0.025, res=1024, chroma=False, luma_scaling=10, seed=42069, show_mask=False, draft=True, matrix=None, kernel=vskernels.Bicubic, **chkdr_args)

Realistic film grain generator.


This function is _incredibly_ slow! It may take multiple minutes to render your clip!
If you still want to use it, I highly recommend setting draft=True!

The generated grain is quite significant, but you can blend the output with the input to attenuate the effect. For this function to work at its best, the image must be in linear light and MUST be an SRGB or GRAY clip.

Please check out the chickendream GitHub page for a full list of parameters and additional information.


Optional Dependencies:

  • adaptivegrain <>_ (luma_scaling > 0)

  • clip (vs.VideoNode) – Input clip.

  • sigma (float) –

    Radius of the gaussian kernel for the vision filter. The larger the radius, the smoother the picture. Smallest values are more prone to aliasing. 0 is a special value indicating that a single-pixel rectangular filter should be used instead of a gaussian. For grains with a small radius (standard use), this should be the fastest option, visually equivalent to sigma = 0.3, offering an excellent quality (minimum leaking between adjascent pixels).

    Valid ranges are between 0 and 1. This is implicitly set to 0 if draft=True.

  • rad (float) – Average grain radius, in pixels. The smaller the grains, the higher the picture fidelity (given a high enough res), and the slower the processing. Must be greater than 0.

  • res (int) –

    Filter resolution, directly translates into the output data bitdepth. Must be greater than 0.

    1024 is equivalent to a 10-bit output. Keep in mind that the pixel values are linear.

    The higher the resolution, the slower the algorithm. Large grains require a smaller res.

  • chroma (bool) – Whether to process chroma or not. If you pass a GRAY clip, this parameter will be ignored.

  • luma_scaling (float) – Scaling for the luma mask. Setting this to 0 will disable it.

  • seed (int) – Seed for the random generator. Defaults to 42069.

  • show_mask (bool) – Return the luma mask. Default: False.

  • draft (bool) –

    Enables the draft mode, much faster to render, but only gives meaningful results for a small subset of the parameter combinations. Implicitely sets sigma to 0, and works correctly with the same conditions (low rad and dev).

    This is the recommended modus for graining, as there is a massive speed increase associated with this setting.

    Set to False to disable and go back to significantly-slower-but-more-accurate graining.

  • matrix (Matrix | int | None) –

    Enum for the matrix of the input clip to process. See lvsfunc.types.Matrix for more info.

    If not specified, gets matrix from the “_Matrix” prop of the clip unless it’s an RGB clip, in which case it stays as None.

  • kernel (Kernel | str) – py:class:vskernels.Kernel object used for conversions between YUV <-> RGB. This can also be the string name of the kernel (Default: py:class:vskernels.Bicubic(b=0, c=1/2)).

  • chkdr_args (Any) – Additional args to pass to chickendream.

Return type



Grained clip in the input clip’s format.