<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Libre Things &#187; diff</title>
	<atom:link href="http://positon.org/tag/diff/feed" rel="self" type="application/rss+xml" />
	<link>http://positon.org</link>
	<description></description>
	<lastBuildDate>Tue, 23 Feb 2016 20:01:11 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.7.1</generator>
	<item>
		<title>Compare / diff between two images</title>
		<link>http://positon.org/compare-diff-between-two-images</link>
		<comments>http://positon.org/compare-diff-between-two-images#comments</comments>
		<pubDate>Mon, 16 Apr 2012 13:00:00 +0000</pubDate>
		<dc:creator><![CDATA[dooblem]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[diff]]></category>
		<category><![CDATA[ImageMagick]]></category>

		<guid isPermaLink="false">http://positon.org:81/?p=115</guid>
		<description><![CDATA[After searching a long time on the Net, here is how to use ImageMagick to compare two images (diff), to determine if the images are similar, or if one image is a resize version of the other. convert image1 image2 -resize '400x300!' MIFF:- &#124; compare -metric AE -fuzz '10%' - null: The convert command takes [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>After searching a long time on the Net, here is how to use ImageMagick to compare two images (diff), to determine if the images are similar, or if one image is a resize version of the other.</p>
<pre>
convert image1 image2 -resize '400x300!' MIFF:- | compare -metric AE -fuzz '10%' - null:
</pre>
<p>The convert command takes 2 images and scale them to a smaller identical size. We then pipe them to the compare command. The compare command will count the number of different pixels.</p>
<p>The command displays the number of different pixels. If it&#8217;s zero then pictures are similar.</p>
<p>2 parameters can increase the similarity tolerance:</p>
<ul>
<li>The size of thumbnails to compare: the smaller it is, the more details are removed. You can use 1/4 of the smaller image for example.</li>
<li>The -fuzz parameter: the color distance tolerance. The more you increase this param, the more you allow different colors. Color difference is almost undetectable below 2%.</li>
</ul>
<p>Notes:</p>
<ul>
<li>It&#8217;s better to keep ratio while generating thumbnails.</li>
<li>The exclamation mark is needed to force image scale without preserving ratio. Otherwise in some cases the 2 thumbs are not strictly the same size and the compare command fails.</li>
</ul>
<p>I also made a small script to scale at 1/4 of the small image and displays the percentage of different pixels: <a href="/wp-content/uploads/dotclearold/imdiff">imdiff</a></p>
<pre>
./imdiff /tmp/bad.jpg ../Public/images/bad.jpg
pixel difference: 2.927%
NOK
</pre>
<p>Links:</p>
<ul>
<li><a href="http://www.imagemagick.org/script/compare.php" title="http://www.imagemagick.org/script/compare.php">http://www.imagemagick.org/script/compare.php</a></li>
<li><a href="http://www.imagemagick.org/Usage/compare/" title="http://www.imagemagick.org/Usage/compare/">http://www.imagemagick.org/Usage/compare/</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://positon.org/compare-diff-between-two-images/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>(Français) Colorer la sortie d&#8217;une commande</title>
		<link>http://positon.org/colorer-la-sortie-dune-commande</link>
		<comments>http://positon.org/colorer-la-sortie-dune-commande#comments</comments>
		<pubDate>Thu, 02 Jul 2009 14:28:00 +0000</pubDate>
		<dc:creator><![CDATA[dooblem]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[diff]]></category>
		<category><![CDATA[vi]]></category>

		<guid isPermaLink="false">http://positon.org:81/?p=55</guid>
		<description><![CDATA[Sorry, this entry is only available in Français.]]></description>
				<content:encoded><![CDATA[<p>Sorry, this entry is only available in <a href="http://fr.positon.org/tag/diff/feed">Français</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://positon.org/colorer-la-sortie-dune-commande/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
