<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.selur.net/index.php?action=history&amp;feed=atom&amp;title=Vapoursynth_KNLMeansCL</id>
	<title>Vapoursynth KNLMeansCL - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.selur.net/index.php?action=history&amp;feed=atom&amp;title=Vapoursynth_KNLMeansCL"/>
	<link rel="alternate" type="text/html" href="https://wiki.selur.net/index.php?title=Vapoursynth_KNLMeansCL&amp;action=history"/>
	<updated>2026-11-19T06:08:42Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.2</generator>
	<entry>
		<id>https://wiki.selur.net/index.php?title=Vapoursynth_KNLMeansCL&amp;diff=546&amp;oldid=prev</id>
		<title>Selur: Update to current Hybrid behaviour; code as &lt;pre&gt; (via update-page on MediaWiki MCP Server)</title>
		<link rel="alternate" type="text/html" href="https://wiki.selur.net/index.php?title=Vapoursynth_KNLMeansCL&amp;diff=546&amp;oldid=prev"/>
		<updated>2026-11-16T08:50:07Z</updated>

		<summary type="html">&lt;p&gt;Update to current Hybrid behaviour; code as &amp;lt;pre&amp;gt; (via update-page on MediaWiki MCP Server)&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw-interface=&quot;&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 09:50, 16 November 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l34&quot;&gt;Line 34:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 34:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Example ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Example ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Default settings on a 10-bit YUV 4:2:0 source (YUV goes through the wrapper):&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Default settings on a 10-bit YUV 4:2:0 source (YUV goes through the wrapper):&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;syntaxhighlight lang=&quot;python&quot;&lt;/del&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pre&lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# denoising using KNLMeansCL&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# denoising using KNLMeansCL&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;clip = denoise.KNLMeansCL(clip, device_type=&amp;quot;gpu&amp;quot;, device_id=0, tools={&amp;#039;nlmeans&amp;#039;: &amp;#039;knlm&amp;#039;})&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;clip = denoise.KNLMeansCL(clip, device_type=&amp;quot;gpu&amp;quot;, device_id=0, tools={&amp;#039;nlmeans&amp;#039;: &amp;#039;knlm&amp;#039;})&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;syntaxhighlight&lt;/del&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pre&lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== How Hybrid calls it ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== How Hybrid calls it ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Selur</name></author>
	</entry>
	<entry>
		<id>https://wiki.selur.net/index.php?title=Vapoursynth_KNLMeansCL&amp;diff=233&amp;oldid=prev</id>
		<title>Selur: New filter page (via create-page on MediaWiki MCP Server)</title>
		<link rel="alternate" type="text/html" href="https://wiki.selur.net/index.php?title=Vapoursynth_KNLMeansCL&amp;diff=233&amp;oldid=prev"/>
		<updated>2026-11-14T20:53:26Z</updated>

		<summary type="html">&lt;p&gt;New filter page (via create-page on MediaWiki MCP Server)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;div style=&amp;quot;float:right; margin:0 0 1em 1em;&amp;quot;&amp;gt;__TOC__&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;KNLMeansCL&amp;#039;&amp;#039;&amp;#039; is a non-local means denoiser. For each pixel it looks for similar patches in its surroundings and in the neighbor frames and averages them by similarity; this removes noise while keeping repeating structures. The original plugin runs on OpenCL; Hybrid can also use CPU, Vulkan and CUDA versions of the algorithm.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Filtering → Vapoursynth → DeNoise&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Vapoursynth_KNLMeansCL.png|none|KNLMeansCL controls in Hybrid]]&lt;br /&gt;
&lt;br /&gt;
== What it does ==&lt;br /&gt;
Around each pixel a search window is scanned; every candidate patch is compared with the patch around the pixel, and the more similar it is, the more it contributes to the average. With &amp;#039;&amp;#039;Distance&amp;#039;&amp;#039; above 0 the same search runs in the neighbor frames.&lt;br /&gt;
&lt;br /&gt;
== Settings ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Control !! Parameter !! Range / values !! Hybrid default !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| Distance || d || 0 – 100 || 1 || Frames on each side (2d+1 in total); 0 = spatial only.&lt;br /&gt;
|-&lt;br /&gt;
| Search radius || a || 1 – 16 || 2 || Search window of (2a+1)² pixels.&lt;br /&gt;
|-&lt;br /&gt;
| Similarity radius || s || 1 – 8 || 4 || Compared patch of (2s+1)² pixels.&lt;br /&gt;
|-&lt;br /&gt;
| Strength || h || 0.01 – 50 || 1.2 || Higher removes more noise.&lt;br /&gt;
|-&lt;br /&gt;
| Channels || channels || auto, Y, UV, YUV, RGB || auto || Planes that are filtered; auto filters RGB clips as RGB and YUV clips on all planes.&lt;br /&gt;
|-&lt;br /&gt;
| Weighting || wmode || Welsch, Modified Bisquare (less robust), Bisquare, Modified Bisquare (more robust) || Welsch || Weighting function.&lt;br /&gt;
|-&lt;br /&gt;
| Device type || device_type || cpu, gpu || gpu || OpenCL device class; knlm only.&lt;br /&gt;
|-&lt;br /&gt;
| Device || device_id || 0 – 4 || 0 || Device number; for knlm on the GPU and for vszipcl/vszipcu.&lt;br /&gt;
|-&lt;br /&gt;
| Tools: NLMeans || – || knlm, vszip, nlm_ispc, knlmvk, vszipcl, vszipcu || knlm (macOS: vszip) || Implementation: knlm (OpenCL), vszip and nlm_ispc (CPU), knlmvk (Vulkan, VapourSynth R80+), vszipcl (OpenCL), vszipcu (NVIDIA CUDA).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
Default settings on a 10-bit YUV 4:2:0 source (YUV goes through the wrapper):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# denoising using KNLMeansCL&lt;br /&gt;
clip = denoise.KNLMeansCL(clip, device_type=&amp;quot;gpu&amp;quot;, device_id=0, tools={&amp;#039;nlmeans&amp;#039;: &amp;#039;knlm&amp;#039;})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How Hybrid calls it ==&lt;br /&gt;
* RGB clips are filtered directly. For YUV clips with &amp;#039;&amp;#039;auto&amp;#039;&amp;#039; or &amp;#039;&amp;#039;YUV&amp;#039;&amp;#039; Hybrid uses a small wrapper from its script collection: 4:4:4 in one pass, subsampled clips first on luma and then on chroma, gray clips on luma.&lt;br /&gt;
* Values are only written when they differ from the defaults; the device type is always written for knlm, the device number for knlm on the GPU and for vszipcl/vszipcu.&lt;br /&gt;
* With knlmvk the frames are downloaded from the GPU afterwards.&lt;br /&gt;
* KNLMeansCL also offers the [[Vapoursynth common filter options|common options]] (Masked, ApplyOnlyTo, Merge, OnRegion, Gimmick).&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
=== KNLMeansCL ===&lt;br /&gt;
Khanattila&amp;#039;s KNLMeansCL is an OpenCL implementation of non-local means for AviSynth and VapourSynth (GPL-3.0). Its own &amp;#039;&amp;#039;channels=auto&amp;#039;&amp;#039; filters only luma on YUV clips, and its own &amp;#039;&amp;#039;device_type=auto&amp;#039;&amp;#039; tries accelerators, then GPUs, then the CPU. An optional reference clip can be used to compute the weights; frames up to 8192×8192 are supported.&lt;br /&gt;
&lt;br /&gt;
=== The other implementations ===&lt;br /&gt;
The CPU and GPU ports give similar but not identical pictures: knlm, nlm_ispc and the vszip versions form three groups.&lt;br /&gt;
&lt;br /&gt;
== Sources ==&lt;br /&gt;
* [https://github.com/Khanattila/KNLMeansCL KNLMeansCL]&lt;br /&gt;
* [https://github.com/Khanattila/KNLMeansCL/wiki/Filter-description KNLMeansCL filter description]&lt;br /&gt;
* Hybrid&amp;#039;s tooltips&lt;br /&gt;
&lt;br /&gt;
[[Category:Vapoursynth Filters]]&lt;/div&gt;</summary>
		<author><name>Selur</name></author>
	</entry>
</feed>