<?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>Syntopia &#187; Pixel Reshuffling</title>
	<atom:link href="http://blog.hvidtfeldts.net/index.php/category/pixel-reshuffling/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.hvidtfeldts.net</link>
	<description>Generative Art, 3D Fractals, Creative Computing</description>
	<lastBuildDate>Mon, 06 Feb 2012 21:35:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Liquid Pixels</title>
		<link>http://blog.hvidtfeldts.net/index.php/2010/03/liquid-pixels/</link>
		<comments>http://blog.hvidtfeldts.net/index.php/2010/03/liquid-pixels/#comments</comments>
		<pubDate>Wed, 24 Mar 2010 22:08:21 +0000</pubDate>
		<dc:creator>Mikael Hvidtfeldt Christensen</dc:creator>
				<category><![CDATA[Digital Art]]></category>
		<category><![CDATA[Pixel Reshuffling]]></category>

		<guid isPermaLink="false">http://blog.hvidtfeldts.net/?p=357</guid>
		<description><![CDATA[A few days ago, I found this little gem on the always inspiring WOWGREAT tumbleblog: Hiroshi Sugimoto, Tyrrhenian Sea (1994); Pixels sorted by Blue. It was created by Jordan Tate and Adam Tindale by sorting the pixels of this picture. &#8230; <a href="http://blog.hvidtfeldts.net/index.php/2010/03/liquid-pixels/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>A few days ago, I found this little gem on the always inspiring <a href="http://wowgreat.tumblr.com/">WOWGREAT</a> tumbleblog:</p>
<p><a href="http://losslessprocessing.tumblr.com/post/450962290/hiroshi-sugimoto-tyrrhenian-sea-1994-pixels"><img src="/media/sea.jpg" /></a><br />
<i>Hiroshi Sugimoto, Tyrrhenian Sea (1994); Pixels sorted by Blue.</i></p>
<p>It was created by Jordan Tate and Adam Tindale by sorting the pixels of <a href="http://www.christies.com/LotFinder/lot_details.aspx?intObjectID=4184156">this picture</a>. See their site, <a href="http://losslessprocessing.tumblr.com/">Lossless processing</a>, for more pixel shuffling goodness. </p>
<h3>Adding some randomness</h3>
<p>I liked the concept, so I decided to try something similar. But instead of sorting the pixels, I had this vague idea of somehow stirring the pixels in an image, and letting the pixels settle into layers. Or something.</p>
<p>After trying out a few different schemes, I came up with the following procedure:</p>
<ol>
<li>Pick two pixels from a random column. Swap them if the upper pixel has a higher hue than the lower pixel.
<li>Pick two pixels from a random row. Swap them if the left pixel has a higher saturation (or brightness) than the right pixel.
<li>Repeat the above steps until the image converges.
</ol>
<p>The first step takes care of the layering of the colors. The second step adds some structure and makes sure the process converges. (If we just swapped two arbitrary pixels, based on the hue, the process would not converge. By swapping pixels column-wise and adding the second step, we impose a global ordering on the image). </p>
<h3>Examples</h3>
<p>The following are some examples of the method (applied to some photos I took while visiting California recently).</p>
<p><img src="/media/7061s.jpg" /> San Diego.<br />
</p><div class="photo"><p><a class="snap_noshots" href="/media/7061.png" rel="gb_imageset[xs]" title="..."><img src="/media/7061ss.jpg" alt="..." /></a></p><div class="caption">...</div></div><p></p>
<p><img src="/media/7164s.jpg" /> Del Mar I.<br />
</p><div class="photo"><p><a class="snap_noshots" href="/media/7164.png" rel="gb_imageset[xs]" title="..."><img src="/media/7164ss.jpg" alt="..." /></a></p><div class="caption">...</div></div><p></p>
<p><img src="/media/7507s.jpg" /> Californian Desert.<br />
</p><div class="photo"><p><a class="snap_noshots" href="/media/7507.png" rel="gb_imageset[xs]" title="..."><img src="/media/7507ss.jpg" alt="..." /></a></p><div class="caption">...</div></div><p></p>
<p><img src="/media/7223s.jpg" /> Del Mar II.<br />
</p><div class="photo"><p><a class="snap_noshots" href="/media/7223.png" rel="gb_imageset[xs]" title="..."><img src="/media/7223ss.jpg" alt="..." /></a></p><div class="caption">...</div></div><p><br />
And finally, a classic:</p>
<p><img src="/media/mona-lisa.jpg" /> Mona Lisa<br />
</p><div class="photo"><p><a class="snap_noshots" href="/media/monalisa-reshuffle.png" rel="gb_imageset[xs]" title="..."><img src="/media/monalisa-reshuffles.png" alt="..." /></a></p><div class="caption">...</div></div><p></p>
<h3>Implementation</h3>
<p>The Image Reshuffler was implemented in <a href="http://processing.org/">Processing</a>. It was my first try with Processing, and as I expected it was quite easy to use. Personally, I prefer C++ and Qt, but for someone new to programming, Processing would be an obvious choice. </p>
<p>The script is available here: <a href="/media/Reshuffler.pde">reshuffler.pde</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hvidtfeldts.net/index.php/2010/03/liquid-pixels/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

