<?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_SSIMD</id>
	<title>Vapoursynth SSIMD - 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_SSIMD"/>
	<link rel="alternate" type="text/html" href="https://wiki.selur.net/index.php?title=Vapoursynth_SSIMD&amp;action=history"/>
	<updated>2026-11-20T06:26:59Z</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_SSIMD&amp;diff=617&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_SSIMD&amp;diff=617&amp;oldid=prev"/>
		<updated>2026-11-16T08:52:17Z</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:52, 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-l33&quot;&gt;Line 33:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 33:&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 (640x356), downscaled to 320x178:&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 (640x356), downscaled to 320x178:&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;# Resizing with SSIMD: 640x356 -&amp;gt; 320x178&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;# Resizing with SSIMD: 640x356 -&amp;gt; 320x178&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 = nnedi3_resample.SSIM_downsample(clip, w=320, h=178, smooth=1, use_fmtc=True, fulls=False, fulld=False, tools={&amp;#039;expr&amp;#039;: &amp;#039;akarin&amp;#039;, &amp;#039;boxblur&amp;#039;: &amp;#039;vszip&amp;#039;, &amp;#039;tcanny&amp;#039;: &amp;#039;tcanny&amp;#039;}) # 320x178 - YUV420PS&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 = nnedi3_resample.SSIM_downsample(clip, w=320, h=178, smooth=1, use_fmtc=True, fulls=False, fulld=False, tools={&amp;#039;expr&amp;#039;: &amp;#039;akarin&amp;#039;, &amp;#039;boxblur&amp;#039;: &amp;#039;vszip&amp;#039;, &amp;#039;tcanny&amp;#039;: &amp;#039;tcanny&amp;#039;}) # 320x178 - YUV420PS&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_SSIMD&amp;diff=425&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_SSIMD&amp;diff=425&amp;oldid=prev"/>
		<updated>2026-11-15T08:00:17Z</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;SSIMD&amp;#039;&amp;#039;&amp;#039; is an SSIM-based perceptual downscaler: the picture is first shrunk with a normal kernel and then corrected so that its local structure matches the large original. Perceptually important detail is kept, and the result stays temporally consistent. Hybrid uses it only for downscaling.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Filtering → Vapoursynth → Frame → Resize&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Vapoursynth_SSIMD.png|none|SSIMD controls in Hybrid]]&lt;br /&gt;
&lt;br /&gt;
== What it does ==&lt;br /&gt;
After the pre-downscale, local means and variances of the source and of the small picture are compared on smoothed versions, and the small picture is adjusted so that its local contrast follows the original. &amp;#039;&amp;#039;Smooth type&amp;#039;&amp;#039; and its strength set the size of these local windows. Optionally luma is linearized with a gamma curve first, so the processing happens in linear light.&lt;br /&gt;
&lt;br /&gt;
== Settings ==&lt;br /&gt;
Tick &amp;#039;&amp;#039;&amp;#039;Resizer&amp;#039;&amp;#039;&amp;#039; in the [[Vapoursynth Resizer|Resizer]] page and pick &amp;#039;&amp;#039;SSIMD&amp;#039;&amp;#039; as method.&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;
| Smooth type || – || box, tcanny || box || How the local windows are smoothed; picks which strength field is shown.&lt;br /&gt;
|-&lt;br /&gt;
| Box radius || smooth || 0 – 100 || 1 || Box blur of (2 × radius + 1)² pixels: 1 = 3×3, 0 = no smoothing.&lt;br /&gt;
|-&lt;br /&gt;
| Sigma || smooth || 0 – 100 || 0.5 || Gaussian sigma (with tcanny).&lt;br /&gt;
|-&lt;br /&gt;
| Kernel || kernel || Point, Rect, Linear, Bicubic, Lanczos, Blackman, BlackmanMinLobe, Spline16, Spline36, Spline64, Gauss, Sinc || Bicubic || fmtconv kernel of the pre-downscale.&lt;br /&gt;
|-&lt;br /&gt;
| Gamma correction || gamma || on/off || off || Linearizes luma (16 bit) before processing and re-applies the gamma afterwards.&lt;br /&gt;
|-&lt;br /&gt;
| Gamma curve || curve || 709, 601, 170, 240, 2020, srgb || 709 || Transfer curve used for the linearization; only with Gamma correction.&lt;br /&gt;
|-&lt;br /&gt;
| Sigmoid || sigmoid || on/off || off || Sigmoidal light curve that reduces dark halos from linear-light resizing; only with Gamma correction.&lt;br /&gt;
|-&lt;br /&gt;
| Tools: Expr, BoxBlur, TCanny || – || Expr: akarin, cranexpr, std; BoxBlur: vszip, std; TCanny: tcanny, std || – || Implementations; BoxBlur or TCanny is shown according to the smooth type (TCanny with std uses three box blurs).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
Default settings on a 10-bit YUV 4:2:0 source (640x356), downscaled to 320x178:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Resizing with SSIMD: 640x356 -&amp;gt; 320x178&lt;br /&gt;
clip = nnedi3_resample.SSIM_downsample(clip, w=320, h=178, smooth=1, use_fmtc=True, fulls=False, fulld=False, tools={&amp;#039;expr&amp;#039;: &amp;#039;akarin&amp;#039;, &amp;#039;boxblur&amp;#039;: &amp;#039;vszip&amp;#039;, &amp;#039;tcanny&amp;#039;: &amp;#039;tcanny&amp;#039;}) # 320x178 - YUV420PS&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How Hybrid calls it ==&lt;br /&gt;
* SSIMD scales to the target size of the Crop/Resize tab; the pre-downscale always uses fmtconv. Separately filtered fields are handled at field height.&lt;br /&gt;
* If the target is larger than the current size in either dimension, SSIMD is skipped and fmtconv resizes with Spline64.&lt;br /&gt;
* The output is 32-bit float (RGB, YUV 4:2:0 or YUV 4:4:4); Hybrid tracks this. The source range is passed as input and output range.&lt;br /&gt;
* Kernel is written when it is not Bicubic.&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
=== SSIM-based downscaling ===&lt;br /&gt;
The method is a modified implementation of the SSIM-based perceptual downscaling by Öztireli and Gross (2015). Apart from the gamma step all calculations run in 32-bit float. An integer smooth value means a box radius, a decimal value a Gaussian sigma.&lt;br /&gt;
&lt;br /&gt;
== Sources ==&lt;br /&gt;
* [https://github.com/HomeOfVapourSynthEvolution/nnedi3_resample nnedi3_resample]&lt;br /&gt;
* Öztireli &amp;amp; Gross: Perceptually Based Downscaling of Images, SIGGRAPH 2015&lt;br /&gt;
* [https://github.com/Selur/VapoursynthScriptsInHybrid VapoursynthScriptsInHybrid] (the script collection Hybrid uses)&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>