<?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>Last Instinct &#187; Graphics and effects</title>
	<atom:link href="http://last.instinct.se/category/graphics-and-effects/feed" rel="self" type="application/rss+xml" />
	<link>http://last.instinct.se</link>
	<description>Web, design and coolness</description>
	<lastBuildDate>Tue, 22 Mar 2011 19:29:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Update of the Alchemy JPEG encoder for AS3</title>
		<link>http://last.instinct.se/graphics-and-effects/update-of-the-alchemy-jpeg-encoder-for-as3/916</link>
		<comments>http://last.instinct.se/graphics-and-effects/update-of-the-alchemy-jpeg-encoder-for-as3/916#comments</comments>
		<pubDate>Mon, 27 Sep 2010 21:10:06 +0000</pubDate>
		<dc:creator>Klas Lundberg</dc:creator>
				<category><![CDATA[Graphics and effects]]></category>
		<category><![CDATA[Alchemy]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Image]]></category>
		<category><![CDATA[Pixels]]></category>

		<guid isPermaLink="false">http://last.instinct.se/?p=916</guid>
		<description><![CDATA[The fast asynchronous JPEG encoder made by Mateusz Małczak has been updated. I made a tutorial on how to use the fast JPEG-encoder in Adobe Flash earlier. The new release has resolved memory leaks and the asynchronous encoding shall also be faster. I have not had time to try it out, but you can read [...]]]></description>
			<content:encoded><![CDATA[
<p><img src="http://last.instinct.se/wp-content/uploads/jpeg-mosaic.png" alt="JPEG" title="JPEG" width="242" height="110" class="alignright size-full wp-image-921" />The fast asynchronous JPEG encoder made by <a href="http://www.malczak.info/" target="_blank">Mateusz Małczak</a> has been updated. I made a <a href="http://last.instinct.se/graphics-and-effects/using-the-fast-asynchronous-alchemy-jpeg-encoder-in-flash/640">tutorial on how to use the fast JPEG-encoder in Adobe Flash</a> earlier. The new release has resolved memory leaks and the asynchronous encoding shall also be faster. I have not had time to try it out, but you can read all about it and <a href="http://segfaultlabs.com/devlogs/alchemy-asynchronous-jpeg-encoding-2" target="_blank">download it at segfaultlabs</a>. </p>
<p>Thanks for the update Mateusz!</p>
<div class="topsy_widget_data topsy_theme_hot-pink" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Flast.instinct.se%252Fgraphics-and-effects%252Fupdate-of-the-alchemy-jpeg-encoder-for-as3%252F916%22%2C%20%22style%22%3A%20%22small%22%2C%20%22title%22%3A%20%22Update%20of%20the%20Alchemy%20JPEG%20encoder%20for%20AS3%22%20%7D);"><script type="text/javascript">topsyWidgetPreload({ "url": "http%3A%2F%2Flast.instinct.se%2Fgraphics-and-effects%2Fupdate-of-the-alchemy-jpeg-encoder-for-as3%2F916", "style": "small", "title": "Update of the Alchemy JPEG encoder for AS3" });</script></div>

<div align="right" style="float: right; padding: 0px 0px 1px 5px;"><a name="fb_share" type="button_count" share_url="http://last.instinct.se/graphics-and-effects/update-of-the-alchemy-jpeg-encoder-for-as3/916"></a></div>]]></content:encoded>
			<wfw:commentRss>http://last.instinct.se/graphics-and-effects/update-of-the-alchemy-jpeg-encoder-for-as3/916/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Animated sparkling sunset in Skanör</title>
		<link>http://last.instinct.se/portfolio/animated-sparkling-sunset-in-skanor/793</link>
		<comments>http://last.instinct.se/portfolio/animated-sparkling-sunset-in-skanor/793#comments</comments>
		<pubDate>Tue, 27 Jul 2010 00:30:21 +0000</pubDate>
		<dc:creator>Klas Lundberg</dc:creator>
				<category><![CDATA[Graphics and effects]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[Color]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Photography]]></category>

		<guid isPermaLink="false">http://last.instinct.se/?p=793</guid>
		<description><![CDATA[I got a bit inspired by my previous Sparkling sunset made with Photoshop and wanted to make a proof of concept for Adobe Flash. So I animated the sunset. This is what you can do with Flash without using much code. I have just used a few lines to randomize starting points. All other graphic [...]]]></description>
			<content:encoded><![CDATA[
<p>I got a bit inspired by my previous <a href="http://last.instinct.se/portfolio/sparkling-sunset-in-skanor/767">Sparkling sunset</a> made with Photoshop and wanted to make a proof of concept for Adobe Flash. So I animated the sunset. This is what you can do with Flash without using much code. I have just used a few lines to randomize starting points. All other graphic effects are built into Flash and needs no coding.</p>
<p>Wouldn&#8217;t it be cool if sunsets like these existed?</p>
<p>
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="swfobj_0" width="560" height="360">
      <param name="movie" value="http://last.instinct.se/wp-content/uploads/sparkling-sunset.swf" />
      <param name="allowfullscreen" value="true" />
      <param name="bgcolor" value="#000000" />
      <param name="wmode" value="direct" />
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="http://last.instinct.se/wp-content/uploads/sparkling-sunset.swf" width="560" height="360" allowfullscreen="true" bgcolor="#000000" wmode="direct">
      <!--<![endif]-->
        
      <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>
<br /></p>
<div class="topsy_widget_data topsy_theme_hot-pink" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Flast.instinct.se%252Fportfolio%252Fanimated-sparkling-sunset-in-skanor%252F793%22%2C%20%22shorturl%22%3A%20%22http%3A%2F%2Fis.gd%2FdL1oZ%22%2C%20%22style%22%3A%20%22small%22%2C%20%22title%22%3A%20%22Animated%20sparkling%20sunset%20in%20Skan%C3%B6r%22%20%7D);"><script type="text/javascript">topsyWidgetPreload({ "url": "http%3A%2F%2Flast.instinct.se%2Fportfolio%2Fanimated-sparkling-sunset-in-skanor%2F793", "shorturl": "http://is.gd/dL1oZ", "style": "small", "title": "Animated sparkling sunset in Skanör" });</script></div>

<div align="right" style="float: right; padding: 0px 0px 1px 5px;"><a name="fb_share" type="button_count" share_url="http://last.instinct.se/portfolio/animated-sparkling-sunset-in-skanor/793"></a></div>]]></content:encoded>
			<wfw:commentRss>http://last.instinct.se/portfolio/animated-sparkling-sunset-in-skanor/793/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using the fast asynchronous Alchemy JPEG encoder in Flash</title>
		<link>http://last.instinct.se/graphics-and-effects/using-the-fast-asynchronous-alchemy-jpeg-encoder-in-flash/640</link>
		<comments>http://last.instinct.se/graphics-and-effects/using-the-fast-asynchronous-alchemy-jpeg-encoder-in-flash/640#comments</comments>
		<pubDate>Tue, 13 Apr 2010 23:50:52 +0000</pubDate>
		<dc:creator>Klas Lundberg</dc:creator>
				<category><![CDATA[Graphics and effects]]></category>
		<category><![CDATA[Alchemy]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Image]]></category>
		<category><![CDATA[Pixels]]></category>

		<guid isPermaLink="false">http://last.instinct.se/?p=640</guid>
		<description><![CDATA[If you want to encode JPEG images in AS3 there are a number of encoders to use and obviously there is one that is better than all the rest. Mateusz Małczak has made an excellent JPEG encoder based on the libjpeg C-library compiled into Actionscript using Adobe Alchemy. It not only produces small JPEGs with [...]]]></description>
			<content:encoded><![CDATA[
<p>If you want to encode JPEG images in AS3 there are a number of encoders to use and obviously there is one that is better than all the rest. <a href="http://www.malczak.info/" target="_blank">Mateusz Małczak</a> has made an <a href="http://segfaultlabs.com/devlogs/alchemy-asynchronous-jpeg-encoding" taget="_blank">excellent JPEG encoder</a> based on the <a href="http://www.ijg.org/" target="_blank">libjpeg C-library</a> compiled into Actionscript using <a href="http://labs.adobe.com/technologies/alchemy/" target="_blank">Adobe Alchemy</a>. It not only produces small JPEGs with high quality really fast, but it&#8217;s also asyncronous meaning that it doesn&#8217;t lock up your application while encoding, like many of the other encoders do. This way you can also monitor the progress of the encoding process while encoding. The disadvantage is that you need an extra click from the user to save the file when the process is complete. This is due to limitations in the security model in the Flash Player, which only allow file saving exactly when you make a click, which doesn&#8217;t work with asynchronous scripts. However, this isn&#8217;t a big problem if you make a logic design.</p>
<p>
<h3>Step 1</h3>
<p>Start by making a new Flash File (Actionscript 3.0) and save it in a folder of your choice.</p>
<p>
<h3><a href="http://segfaultlabs.com/devlogs/alchemy-asynchronous-jpeg-encoding-2" title="Download jpegencoder.swc from segfaultlabs"><img src="http://last.instinct.se/wp-content/uploads/step2.png" alt="" title="Download jpegencoder.swc from segfaultlabs" width="324" height="147" class="alignright size-full wp-image-694" /></a>Step 2</h3>
<p><a href="http://segfaultlabs.com/devlogs/alchemy-asynchronous-jpeg-encoding-2" target="_blank">Download the jpegencoder.swc from segfaultlabs</a>. <del cite="http://segfaultlabs.com/devlogs/alchemy-asynchronous-jpeg-encoding-2" datetime="2010-09-27T20:27:48+00:00">Just click on the <em>jpegencoder.swc</em> in the folder <em>/libs/</em></del>. </p>
<p><strong>UPDATE: The library has been updated and is now faster and not leaking memory. Also, you can <a href="http://segfaultlabs.com/devlogs/alchemy-asynchronous-jpeg-encoding-2" target="_blank">download it directly on segfaultlabs</a> without going into the source.</strong></p>
<p>Save the file to the folder where you have your .fla file.</p>
<p><br style="clear: both;" /><br />
<h3>Step 3</h3>
<p>Open the publish settings in flash and select the flash tab. </p>
<p>To get the SWC library working when you publish your swf you need to do a little magic trick, otherwise you will get the error <code>ReferenceError: Error #1065: Variable MainTimeline is not defined</code> when publishing or testing the SWF. To deal with this error we need to include the required things to use SWC libraries in the SWF.</p>
<p><img src="http://last.instinct.se/wp-content/uploads/step3.png" alt="" title="Check the Export SWC in the Publish settings" width="426" height="147" class="alignnone size-full wp-image-698" /><br />
Check the <em>Export SWC</em> checkbox in the publish settings.<br />
<br style="clear: both;" /></p>
<blockquote><p>Note: this setting will also produce another SWC file with the same name as your SWF when publishing. This file is not needed when distributing the SWF to the web or similar and can be deleted.</p></blockquote>
<p>
<h3>Step 4</h3>
<p>Click on Actionscript settings.<br />
<img src="http://last.instinct.se/wp-content/uploads/step4.1.png" alt="" title="Click on Actionscript settings" width="426" height="147" class="alignnone size-full wp-image-707" /></p>
<p>Go to the Library path section. Click on <em>Browse to SWC file</em> and locate the jpegencoder.swc and include it.<br />
<img src="http://last.instinct.se/wp-content/uploads/step4.2.png" alt="" title="Click on Browse to SWC file and locate the jpegencoder.swc and include it." width="426" height="147" class="alignnone size-full wp-image-704" /><br />
Click OK to save your library settings.</p>
<p><strong><em>Voilà! Now you are ready to use the Alchemy JPEG Encoder in your code!</em></strong></p>
<p>
<h3>Initializing the library</h3>
<p>To initialize the Alchemy JPEG library use the following lines in your actionscript:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">import</span> cmodule<span style="color: #000066; font-weight: bold;">.</span>jpegencoder<span style="color: #000066; font-weight: bold;">.</span>CLibInit<span style="color: #000066; font-weight: bold;">;</span>   
&nbsp;
<span style="color: #009900; font-style: italic;">/// init alchemy object</span>
<span style="color: #6699cc; font-weight: bold;">var</span> jpeginit<span style="color: #000066; font-weight: bold;">:</span>CLibInit = <span style="color: #0033ff; font-weight: bold;">new</span> CLibInit<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">// get library</span>
<span style="color: #6699cc; font-weight: bold;">var</span> jpeglib<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Object</span> = jpeginit<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">init</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">// initialize library exported class to an object</span></pre></div></div>

<p>
<h3>Starting the encoder</h3>
<p>To use the encoder simply call the jpeglib.encodeAsync function and use it with a ByteArray. There is also a non-asyncronous function you can use which is a little bit faster. Even if its faster I recommend using the asynchronous function, since it doesn&#8217;t lock up your application while encoding.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #009900; font-style: italic;">// Refer to your own BitmapData object</span>
<span style="color: #6699cc; font-weight: bold;">var</span> imgBitmap<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">BitmapData</span> = someBitmapDataYouHaveAlreadyCreated<span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #009900; font-style: italic;">// Prepare Alchemy objects</span>
<span style="color: #6699cc; font-weight: bold;">var</span> imgData<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">ByteArray</span> = imgBitmap<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">getPixels</span><span style="color: #000000;">&#40;</span>imgBitmap<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">rect</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;;</span>
<span style="color: #6699cc; font-weight: bold;">var</span> imgEncoded<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">ByteArray</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">ByteArray</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
imgData<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">position</span> = <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #009900; font-style: italic;">// Function called when completed</span>
<span style="color: #6699cc; font-weight: bold;">var</span> encodeComplete<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Function</span> = <span style="color: #339966; font-weight: bold;">function</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
    <span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;Encoding complete&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #000000;">&#125;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #009900; font-style: italic;">// Start JPEG encoder</span>
<span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;Start encoding&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #6699cc; font-weight: bold;">var</span> jpegQuality<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span> = <span style="color: #000000; font-weight:bold;">80</span><span style="color: #000066; font-weight: bold;">;</span>
jpeglib<span style="color: #000066; font-weight: bold;">.</span>encodeAsync<span style="color: #000000;">&#40;</span>encodeComplete<span style="color: #000066; font-weight: bold;">,</span> imgData<span style="color: #000066; font-weight: bold;">,</span> imgEncoded<span style="color: #000066; font-weight: bold;">,</span> imgBitmap<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">width</span><span style="color: #000066; font-weight: bold;">,</span> imgBitmap<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">height</span><span style="color: #000066; font-weight: bold;">,</span> jpegQuality<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></pre></div></div>

<p>
<h3>Monitor progress</h3>
<p>To see the progress of the encoding you need to set up a function that monitors the position of the ByteArray reader in the encoder. This is done by simply using a setInterval function during the encoding. Don&#8217;t forget to clear the interval when the encoding is complete.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #009900; font-style: italic;">// Encoding progress monitor function</span>
<span style="color: #6699cc; font-weight: bold;">var</span> encodeProgress<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Function</span> = <span style="color: #339966; font-weight: bold;">function</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
	<span style="color: #009900; font-style: italic;">// Listen to the position of the data reader</span>
	<span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;Encoding progress: &quot;</span> <span style="color: #000066; font-weight: bold;">+</span> <span style="color: #004993;">Math</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">round</span><span style="color: #000000;">&#40;</span>imgData<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">position</span><span style="color: #000066; font-weight: bold;">/</span>imgData<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">length</span><span style="color: #000066; font-weight: bold;">*</span><span style="color: #000000; font-weight:bold;">100</span><span style="color: #000000;">&#41;</span> <span style="color: #000066; font-weight: bold;">+</span> <span style="color: #990000;">&quot;%&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #000000;">&#125;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #009900; font-style: italic;">// Start monitoring the progress of the encoding</span>
<span style="color: #6699cc; font-weight: bold;">var</span> progressMonitor<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span> = <span style="color: #004993;">setInterval</span><span style="color: #000000;">&#40;</span>encodeProgress<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">20</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #009900; font-style: italic;">// Encoding progress complete function</span>
<span style="color: #6699cc; font-weight: bold;">var</span> encodeComplete<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Function</span> = <span style="color: #339966; font-weight: bold;">function</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
	<span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;Encoding complete&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
	<span style="color: #009900; font-style: italic;">// Stop monitoring the progress</span>
	<span style="color: #004993;">clearInterval</span><span style="color: #000000;">&#40;</span>progressMonitor<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #000000;">&#125;</span><span style="color: #000066; font-weight: bold;">;</span></pre></div></div>

<p>
<h3>Full example</h3>
<p>Here is a full example of encoding some graphics into a JPEG while monitoring the progress and then saving it onto the user&#8217;s hard drive. </p>
<div style="background-color: #fff; color: #000; padding: 10px;">› <a href="http://last.instinct.se/downloads/alchemy-jpeg-encoder-flash-example-download"  style="color: #000; font-size: 12pt;">Download full Alchemy JPEG encoder example</a> (FLA)
</div>
<p></p>
<div class="topsy_widget_data topsy_theme_hot-pink" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Flast.instinct.se%252Fgraphics-and-effects%252Fusing-the-fast-asynchronous-alchemy-jpeg-encoder-in-flash%252F640%22%2C%20%22shorturl%22%3A%20%22http%3A%2F%2Ftr.im%2FVCUH%22%2C%20%22style%22%3A%20%22small%22%2C%20%22title%22%3A%20%22Using%20the%20fast%20asynchronous%20Alchemy%20JPEG%20encoder%20in%20Flash%22%20%7D);"><script type="text/javascript">topsyWidgetPreload({ "url": "http%3A%2F%2Flast.instinct.se%2Fgraphics-and-effects%2Fusing-the-fast-asynchronous-alchemy-jpeg-encoder-in-flash%2F640", "shorturl": "http://tr.im/VCUH", "style": "small", "title": "Using the fast asynchronous Alchemy JPEG encoder in Flash" });</script></div>

<div align="right" style="float: right; padding: 0px 0px 1px 5px;"><a name="fb_share" type="button_count" share_url="http://last.instinct.se/graphics-and-effects/using-the-fast-asynchronous-alchemy-jpeg-encoder-in-flash/640"></a></div>]]></content:encoded>
			<wfw:commentRss>http://last.instinct.se/graphics-and-effects/using-the-fast-asynchronous-alchemy-jpeg-encoder-in-flash/640/feed</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
		<item>
		<title>Using Adobe Kuler via AS3 in Flash</title>
		<link>http://last.instinct.se/graphics-and-effects/using-adobe-kuler-via-as3-in-flash/584</link>
		<comments>http://last.instinct.se/graphics-and-effects/using-adobe-kuler-via-as3-in-flash/584#comments</comments>
		<pubDate>Wed, 31 Mar 2010 23:59:04 +0000</pubDate>
		<dc:creator>Klas Lundberg</dc:creator>
				<category><![CDATA[Graphics and effects]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Color]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Kuler]]></category>

		<guid isPermaLink="false">http://last.instinct.se/?p=584</guid>
		<description><![CDATA[A great source for inspiration and making your own color themes is Adobe Kuler. It&#8217;s a free service and features all the common color picking techniques. They also have an API available for non-commercial use. It&#8217;s perfect for use with flash and its really simple to use thanks to the ColorMunch AS3 class by Ben [...]]]></description>
			<content:encoded><![CDATA[
<p>A great source for inspiration and making your own color themes is <a href="http://kuler.adobe.com/" target="_blank">Adobe Kuler</a>. It&#8217;s a free service and features all the common color picking techniques. They also have an API available for non-commercial use. It&#8217;s perfect for use with flash and its really simple to use thanks to the <a href="http://code.google.com/p/colormunch/" taget="_blank">ColorMunch AS3 class</a> by <a href="http://beekay.biz/" target="_blank">Ben Kanizay</a>. I used it for color picking in my <a href="http://last.instinct.se/graphics-and-effects/channel-colorizer-demo-application/554">ChannelColorizer</a>.</p>
<p>Here is a basic example for making a search for &#8220;banana&#8221;-themes from Kuler in Actionscript 3. To use it you need the ColorMunch class an your own Kuler API key. There are some more examples in the <a href="http://code.google.com/p/colormunch/w/list" target="_blank">ColorMunch wiki</a>, but you&#8217;ll find the most useful information in the documentation provided in the ColorMunch zip-package.</p>
<p><a href="http://last.instinct.se/graphics-and-effects/using-adobe-kuler-via-as3-in-flash/584/attachment/bananas-in-the-dark-kuler-theme" rel="attachment wp-att-587" title="Bananas In The Dark - Kuler Theme"><img src="http://last.instinct.se/wp-content/uploads/bananas-in-the-dark-kuler-theme.jpg" alt="" title="Bananas In The Dark - Kuler Theme" width="560" height="112" class="alignnone size-full wp-image-587" /></a></p>
<ul>
<li><a href="http://kuler.adobe.com/api" target="_blank">Register for a Kuler API key</a></li>
<li><a href="http://code.google.com/p/colormunch/downloads/list" target="_blank">Download the ColorMunch class</a> and extract it to your fla-folder.</li>
</ul>
<p><em>Example of using Adobe Kuler in Flash AS3 via the ColorMunch class:</em></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
</pre></td><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">import</span> beekay<span style="color: #000066; font-weight: bold;">.</span>colormunch<span style="color: #000066; font-weight: bold;">.*;</span>
&nbsp;
<span style="color: #009900; font-style: italic;">// creates a new ColorMunch instance with your Kuler API key</span>
<span style="color: #6699cc; font-weight: bold;">var</span> colormunch<span style="color: #000066; font-weight: bold;">:</span>ColorMunch = <span style="color: #0033ff; font-weight: bold;">new</span> ColorMunch<span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;INSERT_YOUR_KULER_API_KEY_HERE&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #009900; font-style: italic;">// At a minimum listen for the 'resultReady' event</span>
<span style="color: #009900; font-style: italic;">// This will fire when the result has been recieved and processed</span>
colormunch<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span>ColorMunchEvent<span style="color: #000066; font-weight: bold;">.</span>RESULT_READY<span style="color: #000066; font-weight: bold;">,</span> onResultReady<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
colormunch<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span>ColorMunchEvent<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">ERROR</span><span style="color: #000066; font-weight: bold;">,</span> onResultError<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #339966; font-weight: bold;">function</span> onResultReady<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">:</span>ColorMunchEvent<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
	<span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;Kuler recieved&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #6699cc; font-weight: bold;">var</span> theme<span style="color: #000066; font-weight: bold;">:</span>Theme = colormunch<span style="color: #000066; font-weight: bold;">.</span>getRandomTheme<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #6699cc; font-weight: bold;">var</span> themeSprite<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Sprite</span> = theme<span style="color: #000066; font-weight: bold;">.</span>getThemeSprite<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
	themeSprite<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">width</span> = <span style="color: #004993;">stage</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">stageWidth</span><span style="color: #000066; font-weight: bold;">;</span>
	themeSprite<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">height</span> = <span style="color: #004993;">stage</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">stageHeight</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
	<span style="color: #009900; font-style: italic;">// Put the theme sprite on the stage</span>
	<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>themeSprite<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
	<span style="color: #009900; font-style: italic;">// Get information about the selected theme</span>
	<span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;Loading theme: &quot;</span> <span style="color: #000066; font-weight: bold;">+</span> theme<span style="color: #000066; font-weight: bold;">.</span>getThemeTitle<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
	<span style="color: #009900; font-style: italic;">// access swatch information through the theme object</span>
	<span style="color: #6699cc; font-weight: bold;">var</span> swatch<span style="color: #000066; font-weight: bold;">:</span>Swatch<span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #6699cc; font-weight: bold;">var</span> col<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">uint</span><span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #6699cc; font-weight: bold;">var</span> cR<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">uint</span><span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #6699cc; font-weight: bold;">var</span> cG<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">uint</span><span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #6699cc; font-weight: bold;">var</span> cB<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">uint</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">for</span> <span style="color: #000000;">&#40;</span><span style="color: #6699cc; font-weight: bold;">var</span> i<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">int</span> = <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">;</span> i <span style="color: #000066; font-weight: bold;">&lt;</span> theme<span style="color: #000066; font-weight: bold;">.</span>getSwatchCount<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span> i<span style="color: #000066; font-weight: bold;">++</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
		<span style="color: #009900; font-style: italic;">// get the color</span>
		swatch= theme<span style="color: #000066; font-weight: bold;">.</span>getSwatchByIndex<span style="color: #000000;">&#40;</span>i<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
		col	= swatch<span style="color: #000066; font-weight: bold;">.</span>getHex<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
		<span style="color: #009900; font-style: italic;">// Split the color into RGB</span>
		cR 	= <span style="color: #000000;">&#40;</span>col <span style="color: #000066; font-weight: bold;">&gt;&gt;</span> <span style="color: #000000; font-weight:bold;">16</span><span style="color: #000000;">&#41;</span> <span style="color: #000066; font-weight: bold;">&amp;</span> 0xFF<span style="color: #000066; font-weight: bold;">;</span>
		cG 	= <span style="color: #000000;">&#40;</span>col <span style="color: #000066; font-weight: bold;">&gt;&gt;</span> <span style="color: #000000; font-weight:bold;">8</span><span style="color: #000000;">&#41;</span> <span style="color: #000066; font-weight: bold;">&amp;</span> 0xFF<span style="color: #000066; font-weight: bold;">;</span>
		cB 	= col <span style="color: #000066; font-weight: bold;">&amp;</span> 0xFF<span style="color: #000066; font-weight: bold;">;</span>
		<span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;RGB:&quot;</span><span style="color: #000066; font-weight: bold;">,</span> cR<span style="color: #000066; font-weight: bold;">,</span> cG<span style="color: #000066; font-weight: bold;">,</span> cB<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #000000;">&#125;</span>	
<span style="color: #000000;">&#125;</span>
<span style="color: #339966; font-weight: bold;">function</span> onResultError<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">:</span>ColorMunchEvent<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
	<span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;Kuler error: &quot;</span> <span style="color: #000066; font-weight: bold;">+</span> event<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">data</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #009900; font-style: italic;">// Everything prepared, now search for 10 &quot;banana&quot; themes starting at 0</span>
colormunch<span style="color: #000066; font-weight: bold;">.</span>searchThemes<span style="color: #000000;">&#40;</span>ColorMunch<span style="color: #000066; font-weight: bold;">.</span>FILTER_NONE<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #990000;">&quot;banana&quot;</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">10</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></pre></td></tr></table></div>

<div class="topsy_widget_data topsy_theme_hot-pink" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Flast.instinct.se%252Fgraphics-and-effects%252Fusing-adobe-kuler-via-as3-in-flash%252F584%22%2C%20%22style%22%3A%20%22small%22%2C%20%22title%22%3A%20%22Using%20Adobe%20Kuler%20via%20AS3%20in%20Flash%22%20%7D);"><script type="text/javascript">topsyWidgetPreload({ "url": "http%3A%2F%2Flast.instinct.se%2Fgraphics-and-effects%2Fusing-adobe-kuler-via-as3-in-flash%2F584", "style": "small", "title": "Using Adobe Kuler via AS3 in Flash" });</script></div>

<div align="right" style="float: right; padding: 0px 0px 1px 5px;"><a name="fb_share" type="button_count" share_url="http://last.instinct.se/graphics-and-effects/using-adobe-kuler-via-as3-in-flash/584"></a></div>]]></content:encoded>
			<wfw:commentRss>http://last.instinct.se/graphics-and-effects/using-adobe-kuler-via-as3-in-flash/584/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Channel Colorizer Demo Application</title>
		<link>http://last.instinct.se/graphics-and-effects/channel-colorizer-demo-application/554</link>
		<comments>http://last.instinct.se/graphics-and-effects/channel-colorizer-demo-application/554#comments</comments>
		<pubDate>Thu, 25 Mar 2010 04:21:49 +0000</pubDate>
		<dc:creator>Klas Lundberg</dc:creator>
				<category><![CDATA[Graphics and effects]]></category>
		<category><![CDATA[Alchemy]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Color]]></category>
		<category><![CDATA[Effect]]></category>
		<category><![CDATA[Filter]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[FX]]></category>
		<category><![CDATA[Image]]></category>
		<category><![CDATA[Kuler]]></category>
		<category><![CDATA[Photography]]></category>
		<category><![CDATA[Pixel Bender]]></category>
		<category><![CDATA[Pixels]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[Webcam]]></category>

		<guid isPermaLink="false">http://last.instinct.se/?p=554</guid>
		<description><![CDATA[Try the live demo of the Channel Colorizer Pixel Bender filter. You can load an image or use your webcam and then change the RGB colors to some cool theme using coloring by Adobe Kuler. And naturally, you can save your images back to your disk to use them for anything you like.]]></description>
			<content:encoded><![CDATA[
<p><a href="http://color.instinct.se/" target="_blank" title="Channel Colorizer by Instinct"><img src="http://last.instinct.se/wp-content/uploads/channelcolorizer-logo.png" alt="" title="Channel Colorizer by Instinct" width="243" height="100" class="alignleft size-full wp-image-558" /></a><a href="http://color.instinct.se/" target="_blank">Try the live demo</a> of the <a href="http://last.instinct.se/graphics-and-effects/color-channel-colorizer-pixel-bender-filter-for-flash-and-photoshop/344">Channel Colorizer Pixel Bender filter</a> I made a couple of weeks ago. You can load an image or use your webcam and then change the RGB colors to some cool theme using coloring by <a href="http://kuler.adobe.com/" target="_blank">Adobe Kuler</a>.  And naturally, you can save your images back to your disk to use them for anything you like.</p>
<p><a href="http://color.instinct.se/" target="_blank" title="Channel Colorizer by Klas Lundberg - Live Demo Screenshot"><img src="http://last.instinct.se/wp-content/uploads/channelcolorizer-screenshot.jpg" alt="" title="Channel Colorizer by Klas Lundberg - Live Demo Screenshot" width="560" height="340" class="alignnone size-full wp-image-559" /></a></p>
<p>Adobe Kuler gives the coloring an extra dimension. You can search for whatever comes to your mind: <em>bananas</em>, <em>fire</em>, <em>happiness</em>, an author or a specific color. Just keep in mind that you have to be a little bit patient with the search times, since the kuler-servers seems to be a bit overloaded.</p>
<p>The demo features a couple of really cool techniques:</p>
<ul>
<li>The <a href="http://www.adobe.com/devnet/pixelbender/" target="_blank">Pixel Bender</a> filter running live with webcam support.</li>
<li>Coloring themes using <a href="http://kuler.adobe.com/" target="_blank">Adobe Kuler</a> via the <a href="http://code.google.com/p/colormunch/" target="_blank">ColorMunch AS3 class</a> by <a href="http://beekay.biz/" target="_blank">Ben Kanizay</a></li>
<li>Asynchronous saving of JPEG-files in Flash based on libjpeg using the <a href="http://segfaultlabs.com/devlogs/alchemy-asynchronous-jpeg-encoding" target="_blank">Alchemy JPEG-encoder AS3 class by Mateusz Małczak</a></li>
</ul>
<p>Go ahead and make some cool images and feel free to post some comments about it!</p>
<div style="background-color: #fff; color: #000; padding: 10px;">
<ul>
<li style="color: #000;"><a href="http://color.instinct.se/" target="_blank" style="color: #000; font-size: 14pt">Try the Channel Colorizer live demo</a>
</li>
<li style="color: #000;"><a href="http://last.instinct.se/graphics-and-effects/color-channel-colorizer-pixel-bender-filter-for-flash-and-photoshop/344" style="color: #000;">Read all about the Channel Colorizer Pixel Bender filter</a></li>
<li style="color: #000;"><a href="http://kuler.adobe.com/#create/fromacolor" target="_blank" style="color: #000;">Make your own color themes using Adobe Kuler</a></li>
<li style="color: #000;"><a href="http://last.instinct.se/downloads/channelcolorizer-pixel-bender-filter-download" style="color: #000;">Download ChannelColorizer Pixel Bender Filter</a></li>
</ul>
</div>
<p><a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/2.5/se/"><img alt="Creative Commons License" style="border-width:0; float: left; margin-right: 10px;" src="http://creativecommons.org/images/public/somerights20.png" /></a><span xmlns:dc="http://purl.org/dc/elements/1.1/" property="dc:title">ChannelColorizer</span> by <a xmlns:cc="http://creativecommons.org/ns#" href="http://www.instinct.se/" property="cc:attributionName" rel="cc:attributionURL">Klas Lundberg</a> is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/2.5/se/">Creative Commons Attribution-Noncommercial-Share Alike 2.5 Sweden</a>.<br />
Feel free to contact me if you want it for commercial use.</p>
<div class="topsy_widget_data topsy_theme_hot-pink" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Flast.instinct.se%252Fgraphics-and-effects%252Fchannel-colorizer-demo-application%252F554%22%2C%20%22shorturl%22%3A%20%22http%3A%2F%2Fis.gd%2Fef4Cd%22%2C%20%22style%22%3A%20%22small%22%2C%20%22title%22%3A%20%22Channel%20Colorizer%20Demo%20Application%22%20%7D);"><script type="text/javascript">topsyWidgetPreload({ "url": "http%3A%2F%2Flast.instinct.se%2Fgraphics-and-effects%2Fchannel-colorizer-demo-application%2F554", "shorturl": "http://is.gd/ef4Cd", "style": "small", "title": "Channel Colorizer Demo Application" });</script></div>

<div align="right" style="float: right; padding: 0px 0px 1px 5px;"><a name="fb_share" type="button_count" share_url="http://last.instinct.se/graphics-and-effects/channel-colorizer-demo-application/554"></a></div>]]></content:encoded>
			<wfw:commentRss>http://last.instinct.se/graphics-and-effects/channel-colorizer-demo-application/554/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Collaborative sketching</title>
		<link>http://last.instinct.se/check-this-out/collaborative-sketching/490</link>
		<comments>http://last.instinct.se/check-this-out/collaborative-sketching/490#comments</comments>
		<pubDate>Mon, 15 Mar 2010 16:46:09 +0000</pubDate>
		<dc:creator>Klas Lundberg</dc:creator>
				<category><![CDATA[Check this out]]></category>
		<category><![CDATA[Graphics and effects]]></category>
		<category><![CDATA[Collaborative]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Graffiti]]></category>
		<category><![CDATA[Sketch]]></category>

		<guid isPermaLink="false">http://last.instinct.se/?p=490</guid>
		<description><![CDATA[Feel like sketch, paint, tag or doing some graffiti? Try this cool onBoard collaborative painting and drawing application made by Jozef Chút&#8217;ka. It has a really powerful sketch tool that seems just magic. And yes, this sketchboard is shared by everyone.]]></description>
			<content:encoded><![CDATA[
<p><a href="http://last.instinct.se/wp-content/uploads/onboard-graffiti-last-instinct.jpg" rel="shadowbox[sbpost-490];player=img;" title="Last Instinct graffiti using onBoard"><img src="http://last.instinct.se/wp-content/uploads/onboard-graffiti-last-instinct-560x202.jpg" alt="" title="Last Instinct graffiti using onBoard" width="560" height="202" class="alignnone size-large wp-image-494" /></a></p>
<p>Feel like sketch, paint, tag or doing some graffiti? Try this cool <a href="http://blog.yoz.sk/2009/10/onboard-collaborative-painting/" target="_blank">onBoard collaborative painting and drawing</a> application made by <a href="http://blog.yoz.sk/" target="_blank">Jozef Chút&#8217;ka</a>. It has a really powerful sketch tool that seems just magic. And yes, this sketchboard is shared by everyone. <img src='http://last.instinct.se/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><img style="visibility:hidden;width:0px;height:0px;" border="0" width="0" height="0" src="http://counters.gigya.com/wildfire/IMP/CXNID=2000002.0NXC/bT*xJmx*PTEyNjg2NjAyNTgzODcmcHQ9MTI2ODY2MDI3Mjc5MCZwPTc4MDA*MSZkPSZnPTImbz*zNDM4NGY*NTQ5YTI*MjgzOWVi/ZmEzNGQ4NThjZGQwZSZvZj*w.gif" /><object width="100%" height="400"><param name="movie" value="http://onBoard.yoz.sk/flash/onBoard.swf"></param><param name="allowScriptAccess" value="always"></param><param name="allowFullscreen" value="true"></param><param name="FlashVars" value="board=_default_&#038;x=5801&#038;y=1145&#038;scale=1&#038;color=66ff66&#038;size=3"></param><embed src="http://onBoard.yoz.sk/flash/onBoard.swf" width="100%" height="400" type="application/x-shockwave-flash" allowScriptAccess="always" allowfullscreen="true" FlashVars="board=_default_&#038;x=5801&#038;y=1145&#038;scale=1&#038;color=66ff66&#038;size=3" ><a href="http://last.instinct.se/check-this-out/collaborative-sketching/490/attachment/onboard-graffiti-last-instinct" rel="attachment wp-att-494" title="Graffiti using onBoard"><img src="http://last.instinct.se/wp-content/uploads/onboard-graffiti-last-instinct-e1268660550835-150x150.jpg" alt="" title="Graffiti using onBoard" width="150" height="150" class="alignnone size-thumbnail wp-image-494" style="display: none;" /></a></embed></object></p>
<div class="topsy_widget_data topsy_theme_hot-pink" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Flast.instinct.se%252Fcheck-this-out%252Fcollaborative-sketching%252F490%22%2C%20%22style%22%3A%20%22small%22%2C%20%22title%22%3A%20%22Collaborative%20sketching%22%20%7D);"><script type="text/javascript">topsyWidgetPreload({ "url": "http%3A%2F%2Flast.instinct.se%2Fcheck-this-out%2Fcollaborative-sketching%2F490", "style": "small", "title": "Collaborative sketching" });</script></div>

<div align="right" style="float: right; padding: 0px 0px 1px 5px;"><a name="fb_share" type="button_count" share_url="http://last.instinct.se/check-this-out/collaborative-sketching/490"></a></div>]]></content:encoded>
			<wfw:commentRss>http://last.instinct.se/check-this-out/collaborative-sketching/490/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ChannelColorizer normalization update</title>
		<link>http://last.instinct.se/graphics-and-effects/channelcolorizer-normalization-update/444</link>
		<comments>http://last.instinct.se/graphics-and-effects/channelcolorizer-normalization-update/444#comments</comments>
		<pubDate>Sun, 14 Mar 2010 12:31:19 +0000</pubDate>
		<dc:creator>Klas Lundberg</dc:creator>
				<category><![CDATA[Graphics and effects]]></category>
		<category><![CDATA[After Effects]]></category>
		<category><![CDATA[Color]]></category>
		<category><![CDATA[Effect]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[FX]]></category>
		<category><![CDATA[Image]]></category>
		<category><![CDATA[Photoshop]]></category>
		<category><![CDATA[Pixel Bender]]></category>
		<category><![CDATA[Pixels]]></category>

		<guid isPermaLink="false">http://last.instinct.se/?p=444</guid>
		<description><![CDATA[The first version of my Color channel colorizer Pixel Bender filter for Flash and Photoshop had some problems with the balancing to preserve detail in the pixture. I decided to take care of this problem and changed the balancing to regular normalization, which normalizes all channels together. I tried this when I was making the [...]]]></description>
			<content:encoded><![CDATA[
<p>The <a href="http://last.instinct.se/graphics-and-effects/color-channel-colorizer-pixel-bender-filter-for-flash-and-photoshop/344">first version of my Color channel colorizer </a>Pixel Bender filter for Flash and Photoshop had some problems with the balancing to preserve detail in the pixture. I decided to take care of this problem and changed the balancing to regular normalization, which normalizes all channels together. I tried this when I was making the previous version, but couldn&#8217;t get it to work properly. The solution was to not include the alpha channel in the normalization. Therefore I made an extra separate normalization only for the alpha channel. </p>
<p>I also added so that the normalization works when color values are too low, not only when they are too high, as in the previous version.</p>
<p>After a bit of testing I realized that I mostly wanted to have resuts that did have some normalization, but not full, since this could make the colors a bit dull. To solve this I added the option to set in percent how much normalization to use in the filter, and the result was great. Setting the normalization to 50% preserves both a lot of details and some of the sharp colors.</p>
<p><a href="http://last.instinct.se/wp-content/uploads/flower-original.jpg" rel="shadowbox[sbpost-444];player=img;" title="Flowers without color adjustment"><img src="http://last.instinct.se/wp-content/uploads/flower-original-150x150.jpg" alt="" title="Flowers without color adjustment" width="112" height="112" class="alignnone size-thumbnail wp-image-387" /></a><a href="http://last.instinct.se/wp-content/uploads/flower-channel-color-conversion.png" rel="shadowbox[sbpost-444];player=img;" title="RGB color conversion - R: #ffff00 G: #ff7f7f B: #ff007f"><img src="http://last.instinct.se/wp-content/uploads/flower-channel-color-conversion.png" alt="RGB color conversion" title="RGB color conversion - R: #ffff00 G: #ff7f7f B: #ff007f" width="104" height="112" class="alignnone size-full wp-image-394" /></a><a href="http://last.instinct.se/wp-content/uploads/flower-colorized.jpg" rel="shadowbox[sbpost-444];player=img;" title="Colorized flowers"><img src="http://last.instinct.se/wp-content/uploads/flower-colorized-150x150.jpg" alt="" title="Colorized flowers" width="112" height="112" class="alignnone size-thumbnail wp-image-388" /></a><a href="http://last.instinct.se/wp-content/uploads/flower-colorized-normalized-50.jpg" rel="shadowbox[sbpost-444];player=img;" title="Flowers colorized with 50% normalization"><img src="http://last.instinct.se/wp-content/uploads/flower-colorized-normalized-50-150x150.jpg" alt="" title="Flowers colorized with 50% normalization" width="112" height="112" class="alignnone size-thumbnail wp-image-454" /></a><a href="http://last.instinct.se/wp-content/uploads/flower-colorized-normalized-100.jpg" rel="shadowbox[sbpost-444];player=img;" title="Flowers colorized with 100% normalization"><img src="http://last.instinct.se/wp-content/uploads/flower-colorized-normalized-100-150x150.jpg" alt="" title="Flowers colorized with 100% normalization" width="112" height="112" class="alignnone size-thumbnail wp-image-455" /></a></p>
<div style="background-color: #fff; color: #000; padding: 10px; font-size: 12pt;">› <a href="http://last.instinct.se/downloads/channelcolorizer-pixel-bender-filter-download" style="color: #000;">Download Channel Colorizer Pixel Bender Filter</a><br />
› <a href="http://last.instinct.se/graphics-and-effects/channel-colorizer-demo-application/554" style="color: #000;">Try the online Channel Colorizer demo</a></div>
<p><a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/2.5/se/"><img alt="Creative Commons License" style="border-width:0; float: left; margin-right: 10px;" src="http://creativecommons.org/images/public/somerights20.png" /></a><span xmlns:dc="http://purl.org/dc/elements/1.1/" property="dc:title">ChannelColorizer</span> by <a xmlns:cc="http://creativecommons.org/ns#" href="http://www.instinct.se/" property="cc:attributionName" rel="cc:attributionURL">Klas Lundberg</a> is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/2.5/se/">Creative Commons Attribution-Noncommercial-Share Alike 2.5 Sweden</a>.<br />
Feel free to contact me if you want it for commercial use.</p>
<div class="topsy_widget_data topsy_theme_hot-pink" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Flast.instinct.se%252Fgraphics-and-effects%252Fchannelcolorizer-normalization-update%252F444%22%2C%20%22style%22%3A%20%22small%22%2C%20%22title%22%3A%20%22ChannelColorizer%20normalization%20update%22%20%7D);"><script type="text/javascript">topsyWidgetPreload({ "url": "http%3A%2F%2Flast.instinct.se%2Fgraphics-and-effects%2Fchannelcolorizer-normalization-update%2F444", "style": "small", "title": "ChannelColorizer normalization update" });</script></div>

<div align="right" style="float: right; padding: 0px 0px 1px 5px;"><a name="fb_share" type="button_count" share_url="http://last.instinct.se/graphics-and-effects/channelcolorizer-normalization-update/444"></a></div>]]></content:encoded>
			<wfw:commentRss>http://last.instinct.se/graphics-and-effects/channelcolorizer-normalization-update/444/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Color channel colorizer Pixel Bender filter for Flash and Photoshop</title>
		<link>http://last.instinct.se/graphics-and-effects/color-channel-colorizer-pixel-bender-filter-for-flash-and-photoshop/344</link>
		<comments>http://last.instinct.se/graphics-and-effects/color-channel-colorizer-pixel-bender-filter-for-flash-and-photoshop/344#comments</comments>
		<pubDate>Fri, 12 Mar 2010 02:18:57 +0000</pubDate>
		<dc:creator>Klas Lundberg</dc:creator>
				<category><![CDATA[Graphics and effects]]></category>
		<category><![CDATA[After Effects]]></category>
		<category><![CDATA[Color]]></category>
		<category><![CDATA[Effect]]></category>
		<category><![CDATA[Filter]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[FX]]></category>
		<category><![CDATA[Image]]></category>
		<category><![CDATA[Photoshop]]></category>
		<category><![CDATA[Pixel Bender]]></category>
		<category><![CDATA[Pixels]]></category>

		<guid isPermaLink="false">http://last.instinct.se/?p=344</guid>
		<description><![CDATA[I had an idea for a (probably) very cool graphic effect for Flash using colorized dots. My intention was to make it so it could be used for images, animations, videos or whatever. To do this effect I realized that I needed a way to change colors of the graphics in an easy and precise [...]]]></description>
			<content:encoded><![CDATA[
<p><a href="http://last.instinct.se/wp-content/uploads/DSCF6261-colorized.jpg" rel="shadowbox[sbpost-344];player=img;" title="Channel Colorization Example - R: #00bef0 G: #ff6300 B: #b63e00"><img src="http://last.instinct.se/wp-content/uploads/DSCF6261-colorized-300x225.jpg" alt="" title="Channel Colorization Example - R: #00bef0 G: #ff6300 B: #b63e00" width="300" height="225" class="alignright size-medium wp-image-357" /></a><br />
<blockquote>I had an idea for a (probably) very cool graphic effect for Flash using colorized dots. My intention was to make it so it could be used for images, animations, videos or whatever. To do this effect I realized that I needed a way to change colors of the graphics in an easy and precise way. Since I&#8217;ve worked a lot with the Pixel Bender Toolkit lately, it came natural to make a pixel bender filter for this task.</p></blockquote>
<p><a href="http://last.instinct.se/wp-content/uploads/channel-color-conversion.png" rel="shadowbox[sbpost-344];player=img;" title="Channel Color Conversion - Red channel: 0,190,240 (#00bef0) Green channel: 255,99,0 (#ff6300) Blue channel: 182,62,0 (#b63e00)"><img src="http://last.instinct.se/wp-content/uploads/channel-color-conversion.png" alt="Channel Color Conversion" title="Channel Color Conversion - Red channel: 0,190,240 (#00bef0) Green channel: 255,99,0 (#ff6300) Blue channel: 182,62,0 (#b63e00)" width="180" height="117" class="alignleft size-full wp-image-359" /></a><br />
The filter is made to change each original RGB channel of an image into a different color, defined by the user. The filter also has support for the transparency in the alpha channel (RGBA format). However, it is a rather abstract thing to understand the effects of changing the transparency in to color or vice versa, so I will leave it for you to experiment with if you really need it.</p>
<p><a href="http://last.instinct.se/wp-content/uploads/DSCF6261-original.jpg" rel="shadowbox[sbpost-344];player=img;" title="Channel Colorization Original"><img src="http://last.instinct.se/wp-content/uploads/DSCF6261-original-150x150.jpg" alt="" title="Channel Colorization Original" width="150" height="150" class="alignright size-thumbnail wp-image-358" /></a>The above image is filtered using the color transformation in the diagram. You can see how the colors differ from the original image to the right.</p>
<p>The filter can be used with two settings, <em>balanced </em>or <em>unbalanced</em>. The default setting is unbalanced which sets the channels to the specific colors exactly. This causes the the colors to go outside the boundaries of the RGB color space when the colors get to intense. The effect is that the colors get cut off at a specific point, when they can&#8217;t get anymore intense. The balanced setting corrects this and normalizes the color so that all details gets preserved and nothing is cutoff. This sounds good right? Well, the negative effect is that <del datetime="2010-03-14T12:12:04+00:00">the colors no longer is the exact colors you specified and</del> sometimes the colors get very dull or desaturated. <ins datetime="2010-03-14T11:21:01+00:00"><a href="http://last.instinct.se/graphics-and-effects/channelcolorizer-normalization-update/444">The filter is now updated and the colors are now correct all the time.</a></ins></p>
<p>Here is an example of the two sides of the balancing with an rather extreme color setting. The <em>picture on the left</em> shows the original image. The <em>picture in the middle</em> has an unbalanced color setting. Here you can see that the image matches the colors but some intense colors in the flower gets too intense and loses detail. When turning on the balancing in <em>the right picture</em>, the detail comes back, <del datetime="2010-03-14T11:21:01+00:00">but the colors no longer match the color setting</del>. Read about <a href="http://last.instinct.se/graphics-and-effects/channelcolorizer-normalization-update/444">the updated normalization</a>.</p>
<p><a href="http://last.instinct.se/wp-content/uploads/flower-original.jpg" rel="shadowbox[sbpost-344];player=img;" title="Flowers without color adjustment"><img src="http://last.instinct.se/wp-content/uploads/flower-original-150x150.jpg" alt="" title="Flowers without color adjustment" width="140" height="140" class="alignnone size-thumbnail wp-image-387" /></a><a href="http://last.instinct.se/wp-content/uploads/flower-channel-color-conversion.png" rel="shadowbox[sbpost-344];player=img;" title="RGB color conversion - R: #ffff00 G: #ff7f7f B: #ff007f"><img src="http://last.instinct.se/wp-content/uploads/flower-channel-color-conversion.png" alt="RGB color conversion" title="RGB color conversion - R: #ffff00 G: #ff7f7f B: #ff007f" width="129" height="140" class="alignnone size-full wp-image-394" /></a><a href="http://last.instinct.se/wp-content/uploads/flower-colorized.jpg" rel="shadowbox[sbpost-344];player=img;" title="Colorized flowers without balancing"><img src="http://last.instinct.se/wp-content/uploads/flower-colorized-150x150.jpg" alt="" title="Colorized flowers without balancing" width="140" height="140" class="alignnone size-thumbnail wp-image-388" /></a><a href="http://last.instinct.se/wp-content/uploads/flower-colorized-balanced.jpg" rel="shadowbox[sbpost-344];player=img;" title="Colorized flowers with balancing"><img src="http://last.instinct.se/wp-content/uploads/flower-colorized-balanced-150x150.jpg" alt="" title="Colorized flowers with balancing" width="140" height="140" class="alignnone size-thumbnail wp-image-389" /></a></p>
<p>The filter can be used in a lot of ways for a lot of purposes and I bet you can find more uses of it:</p>
<ul>
<li>Changing each channel to a different color</li>
<li>Mapping the colors to a specific color theme or scheme</li>
<li>Changing the image to black and white (or decolorize/desaturate) </li>
<li>Changing the image to black and white with a specific color tone or tint (sepia for example)</li>
<li>Creating a color weighted black and white image</li>
<li>Colorizing an image to a specific RGB color</li>
<li>Extracting a specific color channel</li>
</ul>
<p>The filter is primarily made for use with Flash, but works fine with Photoshop as well. To use it in Photoshop you need to <a href="http://www.garunawebdesigner.com/?p=4778" target="_blank">install the Pixel Bender plugin for Photoshop CS4 and copy the Kernel file to the Pixel Bender folder of Photoshop</a>. If you want to use it in Flash or Flex, Lee Brimelow has made some good tutorials on how to <a href="http://theflashblog.com/?cat=44" target="_blank">get started with Pixel Bender and Flash</a>.</p>
<div style="background-color: #fff; color: #000; padding: 10px; font-size: 12pt;">› <a href="http://last.instinct.se/downloads/channelcolorizer-pixel-bender-filter-download" style="color: #000;">Download Channel Colorizer Pixel Bender Filter</a><br />
› <a href="http://last.instinct.se/graphics-and-effects/channel-colorizer-demo-application/554" style="color: #000;">Try the online Channel Colorizer demo</a></div>
<p><a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/2.5/se/"><img alt="Creative Commons License" style="border-width:0; float: left; margin-right: 10px;" src="http://creativecommons.org/images/public/somerights20.png" /></a><span xmlns:dc="http://purl.org/dc/elements/1.1/" property="dc:title">ChannelColorizer</span> by <a xmlns:cc="http://creativecommons.org/ns#" href="http://www.instinct.se/" property="cc:attributionName" rel="cc:attributionURL">Klas Lundberg</a> is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/2.5/se/">Creative Commons Attribution-Noncommercial-Share Alike 2.5 Sweden</a>.<br />
Feel free to contact me if you want it for commercial use.</p>
<div class="topsy_widget_data topsy_theme_hot-pink" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Flast.instinct.se%252Fgraphics-and-effects%252Fcolor-channel-colorizer-pixel-bender-filter-for-flash-and-photoshop%252F344%22%2C%20%22style%22%3A%20%22small%22%2C%20%22title%22%3A%20%22Color%20channel%20colorizer%20Pixel%20Bender%20filter%20for%20Flash%20and%20Photoshop%22%20%7D);"><script type="text/javascript">topsyWidgetPreload({ "url": "http%3A%2F%2Flast.instinct.se%2Fgraphics-and-effects%2Fcolor-channel-colorizer-pixel-bender-filter-for-flash-and-photoshop%2F344", "style": "small", "title": "Color channel colorizer Pixel Bender filter for Flash and Photoshop" });</script></div>

<div align="right" style="float: right; padding: 0px 0px 1px 5px;"><a name="fb_share" type="button_count" share_url="http://last.instinct.se/graphics-and-effects/color-channel-colorizer-pixel-bender-filter-for-flash-and-photoshop/344"></a></div>]]></content:encoded>
			<wfw:commentRss>http://last.instinct.se/graphics-and-effects/color-channel-colorizer-pixel-bender-filter-for-flash-and-photoshop/344/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

