<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://www.avisynth.nl/index.php?action=history&amp;feed=atom&amp;title=MaskTools</id>
	<title>MaskTools - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://www.avisynth.nl/index.php?action=history&amp;feed=atom&amp;title=MaskTools"/>
	<link rel="alternate" type="text/html" href="http://www.avisynth.nl/index.php?title=MaskTools&amp;action=history"/>
	<updated>2026-08-04T23:34:42Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.0</generator>
	<entry>
		<id>http://www.avisynth.nl/index.php?title=MaskTools&amp;diff=7376&amp;oldid=prev</id>
		<title>Raffriff42: add top link to MaskTools2</title>
		<link rel="alternate" type="text/html" href="http://www.avisynth.nl/index.php?title=MaskTools&amp;diff=7376&amp;oldid=prev"/>
		<updated>2015-12-11T00:25:00Z</updated>

		<summary type="html">&lt;p&gt;add top link to MaskTools2&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 02:25, 11 December 2015&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-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&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;{{FilterCat4|External_filters|Other_filters|Support_filters|Masking}}&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;{{FilterCat4|External_filters|Other_filters|Support_filters|Masking}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&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;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;see also&#039;&#039; [[MaskTools2]]&lt;/ins&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;{{Filter&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;{{Filter&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;|Kurosu, Manao&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;|Kurosu, Manao&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Raffriff42</name></author>
	</entry>
	<entry>
		<id>http://www.avisynth.nl/index.php?title=MaskTools&amp;diff=7029&amp;oldid=prev</id>
		<title>Raffriff42: added category</title>
		<link rel="alternate" type="text/html" href="http://www.avisynth.nl/index.php?title=MaskTools&amp;diff=7029&amp;oldid=prev"/>
		<updated>2015-11-10T23:14:11Z</updated>

		<summary type="html">&lt;p&gt;added category&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 01:14, 11 November 2015&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-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&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;{{&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;FilterCat&lt;/del&gt;|External_filters|Other_filters|Support_filters}}&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;{{&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;FilterCat4&lt;/ins&gt;|External_filters|Other_filters|Support_filters&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;|Masking&lt;/ins&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;{{Filter&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;{{Filter&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;|Kurosu, Manao&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;|Kurosu, Manao&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Raffriff42</name></author>
	</entry>
	<entry>
		<id>http://www.avisynth.nl/index.php?title=MaskTools&amp;diff=1308&amp;oldid=prev</id>
		<title>Admin: 1 revision</title>
		<link rel="alternate" type="text/html" href="http://www.avisynth.nl/index.php?title=MaskTools&amp;diff=1308&amp;oldid=prev"/>
		<updated>2013-05-19T22:03:47Z</updated>

		<summary type="html">&lt;p&gt;1 revision&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw-interface=&quot;&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 00:03, 20 May 2013&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>http://www.avisynth.nl/index.php?title=MaskTools&amp;diff=1307&amp;oldid=prev</id>
		<title>Wilbert at 21:52, 19 May 2013</title>
		<link rel="alternate" type="text/html" href="http://www.avisynth.nl/index.php?title=MaskTools&amp;diff=1307&amp;oldid=prev"/>
		<updated>2013-05-19T21:52:14Z</updated>

		<summary type="html">&lt;p&gt;&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 23:52, 19 May 2013&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-l246&quot;&gt;Line 246:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 246:&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;----&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;----&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;Back to [[External filters]]&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;Back to [[External filters]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&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;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&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;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Plugins]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Wilbert</name></author>
	</entry>
	<entry>
		<id>http://www.avisynth.nl/index.php?title=MaskTools&amp;diff=199&amp;oldid=prev</id>
		<title>Admin: 1 revision</title>
		<link rel="alternate" type="text/html" href="http://www.avisynth.nl/index.php?title=MaskTools&amp;diff=199&amp;oldid=prev"/>
		<updated>2013-05-09T15:02:00Z</updated>

		<summary type="html">&lt;p&gt;1 revision&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw-interface=&quot;&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 17:02, 9 May 2013&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>http://www.avisynth.nl/index.php?title=MaskTools&amp;diff=198&amp;oldid=prev</id>
		<title>176.14.100.59: /* Filters */</title>
		<link rel="alternate" type="text/html" href="http://www.avisynth.nl/index.php?title=MaskTools&amp;diff=198&amp;oldid=prev"/>
		<updated>2012-02-03T20:26:14Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Filters&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{FilterCat|External_filters|Other_filters|Support_filters}}&lt;br /&gt;
{{Filter&lt;br /&gt;
|Kurosu, Manao&lt;br /&gt;
|1.5.8&lt;br /&gt;
|[http://manao4.free.fr/MaskTools-v1.5.8.zip manao4.free.fr]&lt;br /&gt;
|Support filters&lt;br /&gt;
|&lt;br /&gt;
* YV12&lt;br /&gt;
|GPL&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
After a processing, you may need to keep only a part of the output. Say, you have a clip named &amp;lt;tt&amp;gt;smooth&amp;lt;/tt&amp;gt; that is the result of a smoothing ([[Blur|blur]]() for instance) on a clip named &amp;lt;tt&amp;gt;source&amp;lt;/tt&amp;gt;.&lt;br /&gt;
Most of the noise from &amp;lt;tt&amp;gt;source&amp;lt;/tt&amp;gt; has disappeared in &amp;lt;tt&amp;gt;smooth&amp;lt;/tt&amp;gt;, but so have details. You may therefore want to only keep filtered pixels and discard those where there are big differences of color or brightness. That&amp;#039;s what does [[MSmooth]] by D. Graft for instance. &lt;br /&gt;
&lt;br /&gt;
Now consider that you write on an image pixels from &amp;lt;tt&amp;gt;smooth&amp;lt;/tt&amp;gt; that you want to keep as white pixels, and the other ones from &amp;lt;tt&amp;gt;source&amp;lt;/tt&amp;gt; as black pixels. You get what is called a mask. MaskTools deals with the creation, the enhancement and the manipulating of such mask for each component of the YV12 colorspace.&lt;br /&gt;
&lt;br /&gt;
== Filters ==&lt;br /&gt;
&lt;br /&gt;
This Avisynth 2.5 YV12-only plugin offers several functions manipulating clips as masks:&lt;br /&gt;
&lt;br /&gt;
{{PluginFilterTable}}&lt;br /&gt;
| [[MaskTools/Binarize|Binarize]] &lt;br /&gt;
| Binarizes the input picture depending on a threshold and a command&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
|-&lt;br /&gt;
| [[MaskTools/CombMask|CombMask]] &lt;br /&gt;
| Outputs a mask which gives areas that presents combing.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
|-&lt;br /&gt;
| [[MaskTools/DEdgeMask|DEdgeMask]] / [[MaskTools/DEdgeMask2|DEdgeMask2]] &lt;br /&gt;
| Builds a mask of the edges of a clip, applying thresholdings (proper values will enable or disable them).&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
|-&lt;br /&gt;
| [[MaskTools/EdgeMask|EdgeMask]] &lt;br /&gt;
| Builds a mask of the edges of a clip, applying thresholdings (proper values will enable or disable them). Similar as [[MaskTools/DEdgeMask|DEdgeMask]] with predefined kernels.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
|-&lt;br /&gt;
| [[MaskTools/FitPlane|FitY2UV / FitY2U / FitY2V / FitU2Y / FitV2Y]]&lt;br /&gt;
| Resizes Y plane and replaces UV/U/V plane(s) by the result of the resize (you can specify your resizer filter, even one that isn&amp;#039;t built-in AviSynth); the opposite functions are FitU2Y and FitV2Y.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
|-&lt;br /&gt;
| [[MaskTools/Expand|Expand]] &lt;br /&gt;
| &amp;#039;Expands&amp;#039; the high values in a plane, by putting in the output the maximum value in the 3x3 neighbourhood around the input pixel. &lt;br /&gt;
| [[YV12]]&lt;br /&gt;
|-&lt;br /&gt;
| [[MaskTools/Inpand|Inpand]]&lt;br /&gt;
| The opposite filter of [[MaskTools/Expand|Expand]].&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
|-&lt;br /&gt;
| [[MaskTools/Inflate|Inflate]] &lt;br /&gt;
| &amp;#039;Inflates&amp;#039; the high values in a plane, by putting in the output plane either the average of the 8 neighbours if it&amp;#039;s higher than the original value, otherwise the original value. &lt;br /&gt;
| [[YV12]]&lt;br /&gt;
|-&lt;br /&gt;
| [[MaskTools/Deflate|Deflate]] &lt;br /&gt;
| The opposite filter of [[MaskTools/Inflate|Inflate]]. Dedicated to Phil Katz.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
|-&lt;br /&gt;
| [[MaskTools/HysteresyMask|HysteresyMask]] &lt;br /&gt;
| Creates a mask from two masks. Theoritically, the first mask should be inside the second one, but it can work if it isn&amp;#039;t true (though results will be less interesting).&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
|-&lt;br /&gt;
| [[MaskTools/Invert|Invert]] &lt;br /&gt;
| Inverts the pixel (i.e. out = 255 - in); this can be also used to apply a &amp;#039;solarize&amp;#039; effect to the picture.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
|-&lt;br /&gt;
| [[MaskTools/Logic|Logic]] &lt;br /&gt;
| Performs most typical logical operations (in fact, the ones provided by [[MMX]] mnemonics, though C functions are still available, mainly because of the picture dimensions limits).&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
|-&lt;br /&gt;
| [[MaskTools/RGBLUT|RGBLUT]] / [[MaskTools/YUY2LUT|YUY2LUT]] / [[MaskTools/YV12LUT|YV12LUT]] / [[MaskTools/YV12LUTxy|YV12LUTxy]] &lt;br /&gt;
| These filters are look-up tables, allowing to apply fastly a function to every pixel of the picture.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
|-&lt;br /&gt;
| [[MaskTools/MaskedMerge|MaskedMerge]] &lt;br /&gt;
| Takes 3 clips and applies a weighted merge between first and second clips depending on the mask represented by the third clip.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
|-&lt;br /&gt;
| [[MaskTools/MotionMask|MotionMask]] &lt;br /&gt;
| Creates a mask of the motion on the picture.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
|-&lt;br /&gt;
| [[MaskTools/OverlayMask|OverlayMask]] &lt;br /&gt;
| Compares 2 clips based on luminance and chrominance thresholds, and outputs whether pixels are close or not (close to what [[ColorKeyMask]] does).&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
|-&lt;br /&gt;
| [[MaskTools/YV12Convolution|YV12Convolution]] &lt;br /&gt;
| Allows you to convolve the picture by the matrix of your choice.&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
|-&lt;br /&gt;
| [[MaskTools/YV12Layer|YV12Layer]] &lt;br /&gt;
| Is the equivalent to [[Overlay]].&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
|-&lt;br /&gt;
| [[MaskTools/YV12Substract|YV12Substract]] &lt;br /&gt;
| Is the same as [[Subtract]], also works in YV12, but &amp;#039;&amp;#039;should&amp;#039;&amp;#039; be a bit faster (because MMX optimised).&lt;br /&gt;
| [[YV12]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Common parameters ==&lt;br /&gt;
&lt;br /&gt;
All the above filters take 3 additional parameters: &amp;lt;tt&amp;gt;Y&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;U&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;V&amp;lt;/tt&amp;gt; (except the [[MaskTools/FitPlane|FitPlane]] filters, where obviously the name tells what is processed). Depending on their value, different operations are applied to each plane:&lt;br /&gt;
&lt;br /&gt;
* value = 3 will do the actual process of the filter,&lt;br /&gt;
* value = 2 will copy the 2nd video plane (if appliable) to the output corresponding plane&lt;br /&gt;
* value = 1 will not process it (i.e., most often, left it with 1st clip plane or garbage - check by yourself)&lt;br /&gt;
* value = [-255...0] will fill the output plane with -value (i.e. to have grey levels, use &amp;lt;tt&amp;gt;U&amp;lt;/tt&amp;gt;=128,&amp;lt;tt&amp;gt;V&amp;lt;/tt&amp;gt;=128)&lt;br /&gt;
&lt;br /&gt;
A last point is the ability of some filters to process only a part of the frame:&lt;br /&gt;
&lt;br /&gt;
* this behaviour is set by the parameters (&amp;lt;tt&amp;gt;offX&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;offY&amp;lt;/tt&amp;gt;) (position of the start point) and (&amp;lt;tt&amp;gt;w&amp;lt;/tt&amp;gt;,&amp;lt;tt&amp;gt;h&amp;lt;/tt&amp;gt;) (width and height of the processed area); filters should modify those parameters so that the processed area is inside the 2 pictures&lt;br /&gt;
* in case of a filter (except [[MaskTools/YV12Layer|YV12Layer]]) using 2 clips, the 2 clips must have the same dimensions&lt;br /&gt;
* in all cases, the picture must be at least MOD8 (MOD16 sometimes) in order to enable the filter to use [[MMX]] functions (ie work at full speed)&lt;br /&gt;
&lt;br /&gt;
This was intended for modularity and atomic operations (or as useful as possible), not really speed. It became both bloated and slow. I let you decide whether this statement is totally true, or a bit less... The examples in filter documentation are most probably much faster applied with the original filters.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
Below are some practical use examples. Be aware that they have not been tested extensivelly. They won&amp;#039;t produce the exact same results as the original filters they try to mimic, in addition to be far more slower. Despite the numerous additional functions, no newer idea.&lt;br /&gt;
&lt;br /&gt;
Notes: &lt;br /&gt;
* I&amp;#039;m too lazy to update the syntax, especially regarding how mode=2 works, and how [[MaskTools/EdgeMask|EdgeMask]] was updated (no longer needs of a [[MaskTools/Binarize|Binarize]] for instance).&lt;br /&gt;
* Some filters I describe as &amp;#039;to create&amp;#039; already exist ([[ImageReader]], [[Levels]] for clamping, ...). &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;1) MSharpen&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 # Build [[MaskTools/EdgeMask|EdgeMask]] of clip1, [[MaskTools/Binarize|Binarize]] it and store the result into clip3&lt;br /&gt;
 # Apply any sharpening filter to clip1 and store it into clip2&lt;br /&gt;
 ...&lt;br /&gt;
 return [[MaskTools/MaskedMerge|MaskedMerge]](clip1, clip2, clip3)&lt;br /&gt;
&lt;br /&gt;
The sharpened edges of clip2 higher than the threshold given to Binarize will be sharpened and used to replace their original value in clip1. You could also write a filter with a particular Look-up table (best would look like a bell), replace Binarize by it, and have a weighed sharpening depending on the edge value: that&amp;#039;s the HiQ part in [[SmartSmoothHiQ]]&lt;br /&gt;
&lt;br /&gt;
 clip2 = clip1.&amp;lt;EdgeEnhancer&amp;gt;(&amp;lt;parameters&amp;gt;)&lt;br /&gt;
 #U and V planes don&amp;#039;t need filtering, Y needs it&lt;br /&gt;
 #EdgeMask(&amp;lt;...&amp;gt;, &amp;quot;roberts&amp;quot;, Y=3, U=-128, V=-128) for greyscale map&lt;br /&gt;
 clip3 = clip1.EdgeMask(15, 60, &amp;quot;roberts&amp;quot;, Y=3, U=1, V=1)&lt;br /&gt;
 return MaskedMerge(clip1, clip2, clip3)&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;2) MSoften&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Replace EdgeEnhancer by a spatial softener (cascaded blurs? spatialsoftenMMX?) and use upper=true to select near-flat pixels.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;3) Rainbow reduction (as described here in [http://forum.doom9.org/showthread.php?s=&amp;amp;threadid=48167 this thread])&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Warning, this isn&amp;#039;t a miracle solution either&lt;br /&gt;
&lt;br /&gt;
 clip2 = clip1 soften at maximum (using deen(&amp;quot;m2d&amp;quot;) or edeen for instance)&lt;br /&gt;
 #Get luma edgemap and increase edges by inflating&lt;br /&gt;
 # -&amp;gt; wider areas to be processed&lt;br /&gt;
 clip3 = clip1.[[MaskTools/EdgeMask|EdgeMask]](6, &amp;quot;roberts&amp;quot;, Y=3, U=1, V=1).[[MaskTools/Inflate|Inflate]](Y=3, U=1, V=1)&lt;br /&gt;
 #Now, use the luma edgemask as a chroma mask&lt;br /&gt;
 clip3 = [[YToUV]](clip3, clip3).[[ReduceBy2]]().Binarize(15, upper=false, Y=1, U=3, V=3)&lt;br /&gt;
 #We have to process pixels&amp;#039; chroma near edges, but keep intact Y plane&lt;br /&gt;
 return MaskedMerge(clip1, clip2, clip3, Y=1, U=3, V=3)&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;4) Supersampled fxtoon&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Not tested&lt;br /&gt;
&lt;br /&gt;
 . Use tweak to darken picture or make a plugin that scales down Y values &lt;br /&gt;
 -&amp;gt; clip2&lt;br /&gt;
 . Build edge mask, Supersample this mask, Binarize it with a high threshold &lt;br /&gt;
 (clamping sounds better), Inflate it -&amp;gt; clip3&lt;br /&gt;
 . Apply the darker pixels of clip2 depending on the values of clip3&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;5) Warpsharp for dark luma&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Not tested&lt;br /&gt;
&lt;br /&gt;
 . Apply warpsharp -&amp;gt; clip2 (replacement pixels)&lt;br /&gt;
 . Create a clamping filter or a low-luma bypass filter -&amp;gt; clip3 (mask)&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;6) pseudo-deinterlacer (chroma will still be problematic)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Not tested&lt;br /&gt;
&lt;br /&gt;
 clip2 = clip1.[[SeparateFields]]().[[SelectEven]]().&amp;lt;Method&amp;gt;Resize(&amp;lt;parameters&amp;gt;)&lt;br /&gt;
 clip3 = clip1.&amp;lt;CombingDetector&amp;gt;(&amp;lt;parameters&amp;gt;)&lt;br /&gt;
 return [[MaskTools/MaskedMerge|MaskedMerge]](clip1, clip2, clip3, Y=3, U=3, V=3)&lt;br /&gt;
&lt;br /&gt;
(chroma even more problematic)&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;7) Non-rectangular overlays&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
In fact, this is handled more nicely by [[Layer]] and [[Mask]]...&lt;br /&gt;
&lt;br /&gt;
 #Simple hack because ImageReader needs an integer fps...&lt;br /&gt;
 #Most sources are natively in YUY2/YV12&lt;br /&gt;
 clip = [[AviSource]](&amp;quot;test.avi&amp;quot;).[[ConvertToYV12]]().[[AssumeFPS]](fps)&lt;br /&gt;
 #Load the picture to be overlayed&lt;br /&gt;
 image = [[ImageReader]](&amp;quot;mask.bmp&amp;quot;, 0, clip.framecount()-1, 24, use_DevIl=false)&lt;br /&gt;
 #Simple way: assume black is transparent &lt;br /&gt;
 #Any other colour would be quite more complicated*&lt;br /&gt;
 masktemp = imageYV12.[[MaskTools/Binarize|Binarize]](17, upper=false, Y=3)&lt;br /&gt;
 #We set the luma mask to fit the chroma planes&lt;br /&gt;
 mask = Mask.[[MaskTools/FitPlane|FitY2UV]]()&lt;br /&gt;
 #Now that we have the mask that tells us what we want to keep...&lt;br /&gt;
 #Replace by image the parts of clip masked by mask!&lt;br /&gt;
 [[MaskTools/MaskedMerge|MaskedMerge]](clip, image, mask, Y=3, U=3, V=3)&lt;br /&gt;
 #*solution: mask = [[MaskTools/OverlayMask|OverlayMask]](image, image.[[BlankClip]](&amp;quot;$xxxxxx&amp;quot;), 1, 1)&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;8) Replace backgrounds&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
This example clearly would look better in [[RGB]]. To avoid typical problems due to noise or compression, you would better use blurred versions of the clip and picture.&lt;br /&gt;
&lt;br /&gt;
 source = AviSource(&amp;quot;overlay.avi&amp;quot;).AssumeFPS(24)&lt;br /&gt;
 #blur the source&lt;br /&gt;
 clip = source.[[Blur]](1.58).Blur(1.58).Blur(1.58)&lt;br /&gt;
 #load the background to replace, captured from the blurred sequence&lt;br /&gt;
 bgnd = ImageReader(&amp;quot;bgnd.ebmp&amp;quot;, 0, clip.framecount()-1, 24, use_DevIl=false)&lt;br /&gt;
 #load new background&lt;br /&gt;
 new = ImageReader(&amp;quot;new.ebmp&amp;quot;, 0, clip.framecount()-1, 24, use_DevIl=false)&lt;br /&gt;
 #integrated filter to output the mask = (clip~overlay?)&lt;br /&gt;
 mask = OverlayMask(clip, overlay.[[ConvertToYV12]](), 10, 10)&lt;br /&gt;
 MaskedMerge(source, new.ConvertToYV12(), mask, Y=3, U=3, V=3)&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;9) K-mfToon&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
I need to include more info (original urls/posts) but for now I think [[Shared_functions/mfToon|mfToon]]&amp;#039;s original author, mf (mf@onthanet.net) will not react too violently to it, while it&amp;#039;s still not addressed.&lt;br /&gt;
&lt;br /&gt;
The output of the function inside K-mfToon.avs should be identical to the output of the original mftoon.avs (also included), with twice the speed.&lt;br /&gt;
&lt;br /&gt;
Required plugins:&lt;br /&gt;
* MaskTools&lt;br /&gt;
* [[WarpSharp]]&lt;br /&gt;
* [[AWarpSharp]]  &lt;br /&gt;
&lt;br /&gt;
== Disclaimer ==&lt;br /&gt;
&lt;br /&gt;
This plugin is released under the GPL license. You must agree to the terms of &amp;#039;Copying.txt&amp;#039; before using the plugin or its source code.&lt;br /&gt;
&lt;br /&gt;
You are also advised to use it in a philanthropic state-of-mind, i.e. not &amp;#039;&amp;#039;&amp;quot;I&amp;#039;ll keep this secret for myself&amp;quot;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
Last but not least, a very little part of all possible uses of each filter was tested (maybe 5% - still a couple of hours spent to debug ;-). Therefore, feedback is _very_ welcome (the opposite - lack of feedback - is also true...)&lt;br /&gt;
&lt;br /&gt;
== Changelog ==&lt;br /&gt;
&lt;br /&gt;
See the latest version of the [[MaskTools/Changelog|MaskTools changelog]].&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; MaskTools will not be further updated; it has been replaced with the newer [[MaskTools2]] plugin. Script writers should prefer to use the newer version in new scripts. Both plugins can be used in parallel, however. This is useful since a few filters (eg, [[MaskTools/YV12Subtract|YV12Subtract]]) were dropped in the newer version. &lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&lt;br /&gt;
Download the latest stable version: [http://manao4.free.fr/MaskTools-v1.5.8.zip Masktools 1.5.8].&lt;br /&gt;
----&lt;br /&gt;
Back to [[External filters]]&lt;/div&gt;</summary>
		<author><name>176.14.100.59</name></author>
	</entry>
</feed>