<?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=ColorDiff</id>
	<title>ColorDiff - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://www.avisynth.nl/index.php?action=history&amp;feed=atom&amp;title=ColorDiff"/>
	<link rel="alternate" type="text/html" href="http://www.avisynth.nl/index.php?title=ColorDiff&amp;action=history"/>
	<updated>2026-08-06T22:00:35Z</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=ColorDiff&amp;diff=11943&amp;oldid=prev</id>
		<title>Reel.Deal: ColorDiff</title>
		<link rel="alternate" type="text/html" href="http://www.avisynth.nl/index.php?title=ColorDiff&amp;diff=11943&amp;oldid=prev"/>
		<updated>2020-06-30T17:43:29Z</updated>

		<summary type="html">&lt;p&gt;ColorDiff&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{FilterCat|External_filters|Plugins|Debugging/Diagnostic_filters}}&lt;br /&gt;
{{Filter3&lt;br /&gt;
|1=[https://github.com/ignus2 Ignus2]&lt;br /&gt;
|2=26th May 2007&lt;br /&gt;
|3=[https://forum.doom9.org/attachment.php?attachmentid=7811&amp;amp;d=1196110203 colordiff.zip]&lt;br /&gt;
|4=Debug filter&lt;br /&gt;
|5=[http://www.gnu.org/licenses/gpl-2.0.txt GPLv2]&lt;br /&gt;
|6=[http://forum.doom9.org/showthread.php?t=116949 Doom9 Forum]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Description ==&lt;br /&gt;
[[ColorDiff]] makes a greyscale (Y8) frame according to the input frame&amp;#039;s pixels&amp;#039; &amp;quot;distance&amp;quot; from a specified color. The diff is calculated by simply getting the diff of the individual color components from the desired color&amp;#039;s components and summing them up. Also, weights can be set for the individual diffs. It can work in YUV, RGB and HSL ([http://en.wikipedia.org/wiki/HSL_color_space wikipedia]) mode. The resulting Y8 frame is greyscale. It&amp;#039;s a kind of MaskHS() in a non-binary (greyscale) way.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039;&amp;lt;/span&amp;gt; [[ColorDiff]] is a C-plugin so it must be loaded using [[Plugins#LoadCPlugin|LoadCPlugin]], except if you&amp;#039;re using AviSynth+, it allows autoloading of C-plugins.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== Requirements ==&lt;br /&gt;
* [x86]: [[AviSynth+]] or [https://sourceforge.net/projects/avisynth2/ AviSynth 2.5.8 or greater]&lt;br /&gt;
* Supported color formats: [[RGB24]], [[RGB32]], [[YUY2]], [[YV12]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== [[Script variables|Syntax and Parameters]] ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ColorDiff(clip, int &amp;quot;c1&amp;quot;, int &amp;quot;c2&amp;quot;, int &amp;quot;c3&amp;quot;, float &amp;quot;w1&amp;quot;, float &amp;quot;w2&amp;quot;, float &amp;quot;w3&amp;quot;, int &amp;quot;threshold&amp;quot;, string &amp;quot;colorspace&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
clip    clip: input clip, can be YUY2 or YV12 for &amp;quot;YUV&amp;quot; colorspace, or RGB for &amp;quot;RGB&amp;quot; or &amp;quot;HSL&amp;quot; colorspace&lt;br /&gt;
int     c1 (range: [0-255] for Y, [0-360] for H): desired color component 1 (Y, R, H)&lt;br /&gt;
int     c2 (range: [0-255]): desired color component 2 (U, G, S)&lt;br /&gt;
int     c2 (range: [0-255]): desired color component 3 (V, B, L)&lt;br /&gt;
float   w1 (default: 1.0): weight of color component 1&lt;br /&gt;
float   w2 (default: 1.0): weight of color component 2&lt;br /&gt;
float   w3 (default: 1.0): weight of color component 3&lt;br /&gt;
int     threshold: if calculated distance &amp;gt; threshold then result will be black.&lt;br /&gt;
         Otherwise result will be white.&lt;br /&gt;
         -1 means don&amp;#039;t use thresholding, result will be the calculated diff value,&lt;br /&gt;
         clamped to 255, then inverted (substracted from 255).&lt;br /&gt;
string  colorspace: the colorspace used to calculate the distance. Can be &amp;quot;YUV&amp;quot;, &amp;quot;RGB&amp;quot; or &amp;quot;HSL&amp;quot;.&lt;br /&gt;
         The desired color components (c1, c2, c3) must also be given in this colorspace.&lt;br /&gt;
 &lt;br /&gt;
output: Y8 greyscale (or binary) mask&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
------&lt;br /&gt;
HSL values are calculated from RGB according to http://en.wikipedia.org/wiki/HSL_color_space&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== Examples ==&lt;br /&gt;
 FFImageSource(&amp;quot;linuXP.jpg&amp;quot;)&lt;br /&gt;
 ConvertToYUY2()&lt;br /&gt;
 ColorDiff(c1=100, c2=100, c3=100, w1=2.0, w2=2.0, w3=2.0, colorspace=&amp;quot;YUV&amp;quot;)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== Changelog ==&lt;br /&gt;
 Version      Date            Changes&amp;lt;br&amp;gt;&lt;br /&gt;
              2007/05/26      - latest release&lt;br /&gt;
              2007/05/09      - initial release&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
== Archived Downloads ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;; width=&amp;quot;600px&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!!width=&amp;quot;100px&amp;quot;| Version&lt;br /&gt;
!!width=&amp;quot;150px&amp;quot;| Download&lt;br /&gt;
!!width=&amp;quot;150px&amp;quot;| Mirror&lt;br /&gt;
|-&lt;br /&gt;
!2007/05/26&lt;br /&gt;
|[https://forum.doom9.org/attachment.php?attachmentid=7811&amp;amp;d=1196110203 colordiff.zip]&lt;br /&gt;
|[https://web.archive.org/web/20200630174022if_/https://files.videohelp.com/u/223002/colordiff.zip colordiff.zip]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
==External Links ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Back to [[External_filters#Debugging.2FDiagnostic_Filters|External Filters]] &amp;amp;larr;&amp;#039;&amp;#039;&amp;#039;&lt;/div&gt;</summary>
		<author><name>Reel.Deal</name></author>
	</entry>
</feed>