<?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>Michael Welford&#187; Generative Art Archives  &#8211; Michael Welford . com</title>
	<atom:link href="http://www.michaelwelford.com/blog/category/generative-art/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.michaelwelford.com</link>
	<description>Subjective meets the objective</description>
	<lastBuildDate>Tue, 03 Mar 2009 11:16:18 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Advanced Flash Line Drawing: Intro</title>
		<link>http://www.michaelwelford.com/blog/advanced-flash-line-drawing-intro/</link>
		<comments>http://www.michaelwelford.com/blog/advanced-flash-line-drawing-intro/#comments</comments>
		<pubDate>Tue, 03 Mar 2009 11:11:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Generative Art]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[intro]]></category>
		<category><![CDATA[lines]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.michaelwelford.com/?p=270</guid>
		<description><![CDATA[One of the most basic and fundamental things to draw with code is a line - in terms of importance it is right up there with the pixel.
Line drawing in Flash is, on the whole, pretty darned fantastic. You get curves, lines, varying stroke widths and colours etc. all nicely anti-aliased with just a few [...]]]></description>
			<content:encoded><![CDATA[<p>One of the most basic and fundamental things to draw with code is a line - in terms of importance it is right up there with the pixel.</p>
<p>Line drawing in Flash is, on the whole, pretty darned fantastic. You get curves, lines, varying stroke widths and colours etc. all nicely anti-aliased with just a few commands thrown at the API. However, when it comes to pure quality and flexibility it has quite a few short comings, which is especially a problem when it comes to drawing interesting, varied, <em>magical</em> lines.</p>
<p>Here&#8217;s a few (to get the ball rolling) limitations with line drawing in the Flash drawing API.</p>
<h5>1. Fractional stroke widths aren&#8217;t supported</h5>
<p>Want a stroke width 0.234 points / pixels wide? Bad luck champ!</p>
<h5>2. Anti-aliasing could be better</h5>
<p>I have no references (anyone?) to the type of anti-aliasing that Flash does, perhaps as a guess it looks like some kind of an A-Buffer or just a basic super sampling algorithm, but whatever it is it could be a whole lot smoother.</p>
<h5>3. Dotted lines aren&#8217;t supported in code</h5>
<p>Easy to hack for straight lines but quite a bit harder for curved lines</p>
<h5>4. Gradients on lines don&#8217;t follow curves</h5>
<h5>5. You can&#8217;t change stroke widths, colours, alpha etc. values smoothly along the length of a line</h5>
<h5>6. Brush strokes, texturing, sampling etc. aren&#8217;t supported</h5>
<h5>7. Line &#8220;edges&#8221; are always perfect and parallel</h5>
<p>Thankfully all of this can be worked around with code (ahh, beautiful, powerful code) which I am going to go through in series to build up some really powerful line drawing code that a lot of nice effects can be achieved with.</p>
<p>If there are any things that you want covered or have seen done (journal article references are also good!) please let me know so that I can have a go at incorporating into this series.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.michaelwelford.com/blog/advanced-flash-line-drawing-intro/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Large Format Flash Printing</title>
		<link>http://www.michaelwelford.com/blog/large-format-flash-printing/</link>
		<comments>http://www.michaelwelford.com/blog/large-format-flash-printing/#comments</comments>
		<pubDate>Sun, 01 Feb 2009 12:16:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Generative Art]]></category>
		<category><![CDATA[air]]></category>
		<category><![CDATA[export]]></category>
		<category><![CDATA[printing]]></category>

		<guid isPermaLink="false">http://mw001/?p=85</guid>
		<description><![CDATA[Large format printing from Flash has always been difficult. By &#8220;Large Format&#8221; I mean LARGE - for instance, 5 metres wide by 3 metres tall at 72dpi or in computer pixel terms approx. 14,000 pixels wide by 8,400 pixels tall.
Over the years there has been a number of work arounds / solutions. The following is [...]]]></description>
			<content:encoded><![CDATA[<p>Large format printing from Flash has always been difficult. By &#8220;Large Format&#8221; I mean <em>LARGE</em> - for instance, 5 metres wide by 3 metres tall at 72dpi or in computer pixel terms approx. 14,000 pixels wide by 8,400 pixels tall.</p>
<p>Over the years there has been a number of work arounds / solutions. The following is a run down:</p>
<h5>1. Print via a vector file.</h5>
<p>This can be accompilshed using a postscript printer driver (back in ye olde days) or by just using Acrobat via print in the context  menu (PC only I believe?). <a href="http://www.joshuadavis.com" target="_blank">Joshua Davis</a> was one off the first to output images via this method. On the bright side this gives you vector output that you can scale up to whatever size you like. On the downside you don&#8217;t get gradients, transparency or effects and since it is vector it can be unwieldy or un-preocessable when you have a few hundred thousand or million vectors (!).</p>
<h5>2. Print the screen to tiles</h5>
<p>This is horrid but it works. Basically hit &#8220;zoom in&#8221; via the Flash context menu on a published SWF then take screenshots to create tiles. Stitch together in your favourite image editor. Ouch.</p>
<h5>3. Output to bitmap tiles directly</h5>
<p>The idea with this is to scale up the containing MovieClip and draw it across a grid of images that cover the output image that is the size that you want. As you are rendering to bitmap you can do all sorts of nice things like gradients, multipasses, transparency etc. The main problem with this is that you get a lot of tiled bitmaps to deal with. The easiest way to deal with the tiled images is to use something like <a href="http://www.imagemagick.org/" target="_blank">Image Magick</a> and automatically create a script file that stitches it all together - one click to stitch. If you want you can also delete the intermediate images via a script. If Air let you call an external program you could save yourself a click (alternatively you could just bundle up a Flash app in something like <a href="http://www.multidmedia.com/" target="_blank">Zinc</a> and that let&#8217;s you call an external program). The size of the tiles can either be a maximum of 2,880 x 2,880 if you are going out from Flash or a maximum of 8,192 x 8,192 if you are using ImageSnapshot in Flex.</p>
<h5>4. Output to bitmap tiles using a single virtual canvas</h5>
<p>This is the same as 3, however you do it via a nice class inbetween to treat the tiles as one big fat canvas, or rather one <a href="http://www.bit-101.com/blog/?p=1199">BigAssCanvas</a>. To get this to work you will need to allocate memory for all the tiles before you do anything with them. This can be a limiting factor and if the output image is too large it won&#8217;t work.</p>
<h5>5. Output to a single bitmap via external image hackery<strong><br />
</strong></h5>
<p>This is mentioned in the comments for <a href="http://www.bit-101.com/blog/?p=1199">BigAssCanvas</a> and is apparently what <a href="http://jot.eriknatzke.com/" target="_blank">Erik Natzke</a> is (was?) doing. The trick involves loading in an image of the dimensions that you wish the output to be, and then you write to the BitmapData of that image before saving. This has the same issue as 4 in that you will be limited by the amount of RAM that you have. Another issue is that you have to create a target image file before you start so it won&#8217;t work if you need to dynamically set the dimensions of the output file. Also check out <a href="http://blog.formatlos.de/2008/05/28/bitmapdataunlimited/" target="_blank">BitmapDataUnlimited</a> for another implementation that works along these lines.</p>
<p>One question is what about bitmap effects? Well I need to test this further! In my initial test I got drop shadows and glow working quite well when I used small tile sizes. I expected there to be artificats when an object got clipped but it seems the Flash renderer is smart enough to work out the bounding box for the effect and clip that (there is a built-in function which does just that!). I guess that there is probably a maximum size for the effect bounding box before the effect will refuse to render but I need to confirm this. I did note that lots of effects on top of each other in the same MovieClip slows rendering down <em>a lot</em> and sometimes kills Flash. You can get around this by layering effects in separate MovieClips or you can just compute the effects yourself!</p>
<p>Personally, if the image isn&#8217;t truly massive (i.e. it fits in RAM), I go with option 4 and if it is truly massive then I head for option 3. To get option 3 to work without allocating a lot of memory you need to make sure that you can render your artwork multiple times. i.e. that it is repeatable. Another thing to notice is that you then have to render the artwork as many times as there are tiles. So if it takes a few minutes or more to render the artwork you could potentially be waiting hours or <em>days</em>.</p>
<p>If you are doing something a bit smaller but still greater than 2880 x 2880 you could try something like <a href="http://visualrinse.com/2008/04/27/swfshot-v01-released-save-images-of-swfs-greater-than-2880-pixels/" target="_blank">SWFShot</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.michaelwelford.com/blog/large-format-flash-printing/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
