<?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>Monovektor &#187; Dithering</title>
	<atom:link href="http://monovektor.com/tag/dithering/feed/" rel="self" type="application/rss+xml" />
	<link>http://monovektor.com</link>
	<description>Graphic Design Blog</description>
	<lastBuildDate>Thu, 10 Jan 2013 13:46:29 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=3.7.41</generator>
	<item>
		<title>EXPERIMENTING WITH LENNA</title>
		<link>http://monovektor.com/2012/03/experimenting-with-lenna/</link>
		<comments>http://monovektor.com/2012/03/experimenting-with-lenna/#comments</comments>
		<pubDate>Thu, 15 Mar 2012 12:21:03 +0000</pubDate>
		<dc:creator><![CDATA[Håkan @ Monovektor]]></dc:creator>
				<category><![CDATA[Graphics]]></category>
		<category><![CDATA[Illustrator]]></category>
		<category><![CDATA[Scriptographer]]></category>
		<category><![CDATA[Display]]></category>
		<category><![CDATA[Dithering]]></category>
		<category><![CDATA[Glitch Art]]></category>
		<category><![CDATA[Mosaics]]></category>
		<category><![CDATA[Pixelart]]></category>
		<category><![CDATA[Rasters]]></category>
		<category><![CDATA[thumb]]></category>

		<guid isPermaLink="false">http://monovektor.com/?p=2328</guid>
		<description><![CDATA[I have been experimenting with different kinds of raster effects lately. Not really breaking any new grounds here but it is fun to try to come up with new stuff and just to play around for a while. The hardest part is to find a suitable image to apply these effects on and most of <a href="http://monovektor.com/2012/03/experimenting-with-lenna/">[more…]</a><br /><br /><small><a href="http://monovektor.com/2012/03/experimenting-with-lenna/">Comment</a> / <a href="http://www.facebook.com/sharer.php?u=http://monovektor.com/2012/03/experimenting-with-lenna/&t=EXPERIMENTING WITH LENNA">Share on Facebook</a> / 
	
	<a href="http://twitter.com/home/?status=EXPERIMENTING+WITH+LENNA:%20http://monovektor.com/2012/03/experimenting-with-lenna/">Tweet</a> / <a href="http://digg.com/submit?phase=2&url=http://monovektor.com/2012/03/experimenting-with-lenna/&title=EXPERIMENTING+WITH+LENNA">Digg</a> / <a href="http://delicious.com/post?url=http://monovektor.com/2012/03/experimenting-with-lenna/&title=EXPERIMENTING+WITH+LENNA">Save on Delicious</a></small><br /><br />]]></description>
				<content:encoded><![CDATA[<p>I have been experimenting with different kinds of raster effects lately. Not really breaking any new grounds here but it is fun to try to come up with new stuff and just to play around for a while. The hardest part is to find a suitable image to apply these effects on and most of the time I just throw some random image just lying in the downloads folder. Then it hit me, I&#8217;ve read about this picture that is somewhat associated with image processing experiments (I believe it was on <a title="Halftone dithering" href="http://caca.zoy.org/wiki/libcaca/study/introduction" target="_blank">this site</a> about dithering). Not because it&#8217;s an optimal image for such operations, on the contrary actually, but because it was what was laying around in time of need. So, without further ado, meet <a title="Wikipedia on Lenna" href="http://en.wikipedia.org/wiki/Lenna" target="_blank">Lenna</a>.</p>
<p><img class="alignnone size-full wp-image-2330" title="Lenna" src="http://monovektor.com/wp-content/uploads/2012/03/Lenna.png" alt="" width="512" height="512" /></p>
<p>Now, when I had an image to work with I quickly wrote a function that divide the image into a number of rectangles that then takes on the average color of its underlying area &#8211; I&#8217;ll be refering to this rectangle as the color sampling area. This function then calls other small functions that applies all the different rasters I could think of. Here is a run-down of the effects.</p>
<p><strong>STANDARD MOSAIC RASTER</strong><br />
This is a pretty straight forward mosaic raster effect but I managed to optimize the process as it&#8217;s usually made by drawing a bunch of rectangles that acts like a pixel. This will put considerable strain to Illustrator because, as we all know, a rectangle has four corners that it has to keep track of. Therefore the amount of anchor points will be four times that of the number of objects.</p>
<p><img class="alignnone size-large wp-image-2340" title="Average color" src="http://monovektor.com/wp-content/uploads/2012/03/00_ras_mos_default-590x590.jpg" alt="" width="590" height="590" /></p>
<p>The image above contains 16,384 rectangle objects which would, under normal circumstances, equal to 65,536 anchor points. But, instead of making rectangles I&#8217;m drawing the objects as vertical lines with strokes applied to the lines the size of the sample area. This way I get by with only half of the anchor points; 32,768. The two images below show the difference.</p>
<p><img class="alignnone size-large wp-image-2339" title="Rectangle paths" src="http://monovektor.com/wp-content/uploads/2012/03/00_ras_mos_block_zoom-590x288.jpg" alt="" width="590" height="288" /></p>
<p>351 rectangles = 1,404 anchor points</p>
<p><img class="alignnone size-large wp-image-2343" title="Stroked paths" src="http://monovektor.com/wp-content/uploads/2012/03/00_ras_mos_stroke_zoom-590x288.jpg" alt="" width="590" height="288" /></p>
<p>351 paths = 702 anchor points</p>
<p>Another advantage, I think, is that I can choose to modify the width of the strokes. Below is an image that has the exact same properties as the previous only the stroke width is half of the color sampled area. This results in a kind of white, vertical interference pattern.</p>
<p><img class="alignnone size-large wp-image-2342" title="Half-width strokes" src="http://monovektor.com/wp-content/uploads/2012/03/00_ras_mos_half-590x587.jpg" alt="" width="590" height="587" /></p>
<p><img class="alignnone size-large wp-image-2341" title="Zoomed half-width strokes" src="http://monovektor.com/wp-content/uploads/2012/03/00_ras_mos_half_zoom-590x269.jpg" alt="" width="590" height="269" /></p>
<p><strong>RGB PIXEL RASTER</strong><br />
This is supposed to imitate the pixels of old cathode ray TVs. Nothing fancy but just something that I had to try out.</p>
<p><img class="alignnone size-large wp-image-2344" title="RGB pixel array" src="http://monovektor.com/wp-content/uploads/2012/03/00_ras_rgb_default-590x590.jpg" alt="" width="590" height="590" /></p>
<p><img class="alignnone size-large wp-image-2347" title="Zoomed RGB pixel array" src="http://monovektor.com/wp-content/uploads/2012/03/00_ras_rgb_zoom-590x348.jpg" alt="" width="590" height="348" /></p>
<p>It made for a somewhat nice effect but not very special. Not until I started to play around and rotating each pixel by 90 degrees increments yielding a very prominent pattern. While I was kinda surprised at the outcome it seems it&#8217;s too limited to be of any use.</p>
<p><img class="alignnone size-large wp-image-2402" title="Rotated RGB pixels" src="http://monovektor.com/wp-content/uploads/2012/03/ras_rgb_rotate-590x590.jpg" alt="" width="590" height="590" /></p>
<p><img class="alignnone size-large wp-image-2401" title="Rotated RGB pixels zoomed" src="http://monovektor.com/wp-content/uploads/2012/03/ras_rgb_rotate_zoom-590x327.jpg" alt="" width="590" height="327" /></p>
<p>In an effort to reduce the patterning a bit I let the &#8220;rgb-pixels&#8221; rotate randomly, again in 90 degrees increments.</p>
<p><img class="alignnone size-large wp-image-2405" title="Randomly rotated RGB pixels" src="http://monovektor.com/wp-content/uploads/2012/03/00_ras_rgb_random_rotate-590x590.jpg" alt="" width="590" height="590" /></p>
<p>This could have been it had I not kept on manipulating the outcome. I isolated the different color channels in Photoshop but neither the red nor the blue channel where very interesting. The green one, though, was way cooler.</p>
<p><a href="http://monovektor.com/wp-content/uploads/2012/03/00_ras_rand_rot_comb.jpg"><img class="alignnone size-large wp-image-2426" title="Red &amp; blue channels" src="http://monovektor.com/wp-content/uploads/2012/03/00_ras_rand_rot_comb-590x295.jpg" alt="" width="590" height="295" /></a></p>
<p><img class="alignnone size-large wp-image-2425" title="Green channel" src="http://monovektor.com/wp-content/uploads/2012/03/00_ras_rand_rot_green-590x590.jpg" alt="" width="590" height="590" /></p>
<p>Clearly this cross-hatch pattern has a lot more to offer than the previous two. So much so, in fact, that I imported the result to Photoshop where I ramped up the contrast and had the green color desaturated.</p>
<p><img class="alignnone size-large wp-image-2430" title="Greens turned gray" src="http://monovektor.com/wp-content/uploads/2012/03/00_ras_rand_rot_gray-590x590.jpg" alt="" width="590" height="590" /></p>
<p>I feel the end-result is interesting enough to warrant its own script. Got to get to it.</p>
<p><strong>DASHED RGB PIXEL RASTER</strong><br />
When thinking of CRT pixels I came up with yet another way. What if the red, green and blue intensity of each pixel was always at its maximum value and instead just activate parts of it. I don&#8217;t really know how to explain it, but I&#8217;ll give it a try. Below, anyway, is the final outcome and at first, it didn&#8217;t come out quite as I expected. It looks kinda inverted, but&#8230;</p>
<p><a href="http://monovektor.com/wp-content/uploads/2012/03/00_ras_das_default.jpg"><img class="alignnone size-large wp-image-2337" title="Dashed RGB pixel array" src="http://monovektor.com/wp-content/uploads/2012/03/00_ras_das_default-590x590.jpg" alt="" width="590" height="590" /></a></p>
<p>&#8230;the colors are still preserved and when adding a black background it turns the image into this.</p>
<p><a href="http://monovektor.com/wp-content/uploads/2012/03/00_ras_das_background.jpg"><img class="alignnone size-large wp-image-2336" title="Dashed with black background" src="http://monovektor.com/wp-content/uploads/2012/03/00_ras_das_background-590x590.jpg" alt="" width="590" height="590" /></a></p>
<p><img class="alignnone size-large wp-image-2335" title="Zoomed dashed RGB pixel array" src="http://monovektor.com/wp-content/uploads/2012/03/00_ras_das_background_zoom-590x337.jpg" alt="" width="590" height="337" /></p>
<p>Each of the sampled areas are divided into 3 x 8 &#8220;cells&#8221;. The higher value of each color channel the more of the &#8220;cells&#8221; are going to be filled in.</p>
<p><img class="alignnone size-large wp-image-2338" title="Average color/dashed pixel comparisson" src="http://monovektor.com/wp-content/uploads/2012/03/00_ras_das_pixel_compare-590x280.jpg" alt="" width="590" height="280" /></p>
<p>For instance, above is the average color of the complete Lenna image. The color components are, [177, 99, 106], so dividing by 32 and rounding to its nearest integer on each channel, gives [6, 3, 3]. So, for the red channel, 6 out of 8 &#8220;cells&#8221; are filled. Green channel, 3 out of 8 are filled and for the blue &#8211; yep you guessed it &#8211; 3 out of 8. These numbers are then randomly distributed which means that two colors with exactly the same channel values might not be diplayed in the same way.<br />
Unfortunately, Illustrator can only make dashed strokes with a maximum of three dashes and three gaps. Therefore, a line in the form of;</p>
<pre class="brush: jscript; light: true; title: ; notranslate">dashArray = [dash, gap, dash, gap, dash, gap, dash]</pre>
<p>will not display correctly as Illustrator simply ignores the input from the last dash and onwards. Instead &#8211; as a workaround &#8211; the last dash will have to be added to the first. So, let&#8217;s say a color channel array looks like this;</p>
<pre class="brush: jscript; light: true; title: ; notranslate">dashArray = [1, 0, 1, 0, 1, 0, 2]</pre>
<p>In order to be a valid dash array it would have to be re-arranged like this;</p>
<pre class="brush: jscript; light: true; title: ; notranslate">dashArray = [3, 0, 1, 0, 1, 0]</pre>
<p>I don&#8217;t know if I&#8217;m making any sense trying to explain how it works but the end-result is quite nice, I think.</p>
<p><strong>RGB + CMYK PIXEL RASTER</strong><br />
Now this is starting to get a little too far fetched. I split each sample area into an 8 &#8220;cell&#8221; pixel, converted all color channels into binary and performed almost like a bitwise OR operation.</p>
<p><img class="alignnone size-large wp-image-2349" title="RGB + CMYK pixel array" src="http://monovektor.com/wp-content/uploads/2012/03/ras_cmy_default-590x590.jpg" alt="" width="590" height="590" /></p>
<p><img class="alignnone size-large wp-image-2418" title="Color comparisson" src="http://monovektor.com/wp-content/uploads/2012/03/Screen-shot-2012-03-14-at-12.57.04-PM-590x281.png" alt="" width="590" height="281" /></p>
<p>The same average image color as before. The color channels &#8211; in binary &#8211; reads like:</p>
<pre class="brush: jscript; light: true; title: ; notranslate">red   = 10110100
green = 01100011
blue  = 01101001</pre>
<p>Then, taking one number from each channel in sequential order yields RGB values as such:</p>
<pre class="brush: jscript; light: true; title: ; notranslate">Red   = rgb(1, 0, 0)
Cyan  = rgb(0, 1, 1)
White = rgb(1, 1, 1)
Red   = rgb(1, 0, 0)
Blue  = rgb(0, 0, 1)
Red   = rgb(1, 0, 0)
Green = rgb(0, 1, 0)</pre>
<p>and finally</p>
<pre class="brush: jscript; light: true; title: ; notranslate">Cyan  = rgb(0, 1, 1)</pre>
<p><img class="alignnone size-large wp-image-2348" title="Zoomed RGB + CMYK pixel array" src="http://monovektor.com/wp-content/uploads/2012/03/00_ras_cmy_zoom-590x298.jpg" alt="" width="590" height="298" /></p>
<p>I know, I&#8217;m not making any sense here and I think the outcome is not very comprehensive either, or nice for that matter. Maybe it could used for glitch art or something. Anyway, one can BARELY work out some details in the image so I guess this one is the least useful of the bunch.</p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>CRIPPLING STIPPLING</title>
		<link>http://monovektor.com/2011/12/crippling-stippling/</link>
		<comments>http://monovektor.com/2011/12/crippling-stippling/#comments</comments>
		<pubDate>Thu, 15 Dec 2011 14:44:07 +0000</pubDate>
		<dc:creator><![CDATA[Håkan @ Monovektor]]></dc:creator>
				<category><![CDATA[Graphics]]></category>
		<category><![CDATA[Illustrator]]></category>
		<category><![CDATA[Scriptographer]]></category>
		<category><![CDATA[Cthulhu]]></category>
		<category><![CDATA[Dithering]]></category>
		<category><![CDATA[Halftone Patterns]]></category>
		<category><![CDATA[Mosaics]]></category>
		<category><![CDATA[Rasters]]></category>
		<category><![CDATA[Stippling]]></category>
		<category><![CDATA[Vectoraster]]></category>
		<category><![CDATA[Voronoi]]></category>

		<guid isPermaLink="false">http://monovektor.com/?p=1922</guid>
		<description><![CDATA[This post is part of, and my reply to, a discussion on the Scriptographer forum regarding how to emulate stippling. I have been thinking of a script like this for a long time &#8211; well, I&#8217;d say it&#8217;s more of a pseudo-stochastic raster than a stippler &#8211; but along the way, more and more problems <a href="http://monovektor.com/2011/12/crippling-stippling/">[more…]</a><br /><br /><small><a href="http://monovektor.com/2011/12/crippling-stippling/">Comment</a> / <a href="http://www.facebook.com/sharer.php?u=http://monovektor.com/2011/12/crippling-stippling/&t=CRIPPLING STIPPLING">Share on Facebook</a> / 
	
	<a href="http://twitter.com/home/?status=CRIPPLING+STIPPLING:%20http://monovektor.com/2011/12/crippling-stippling/">Tweet</a> / <a href="http://digg.com/submit?phase=2&url=http://monovektor.com/2011/12/crippling-stippling/&title=CRIPPLING+STIPPLING">Digg</a> / <a href="http://delicious.com/post?url=http://monovektor.com/2011/12/crippling-stippling/&title=CRIPPLING+STIPPLING">Save on Delicious</a></small><br /><br />]]></description>
				<content:encoded><![CDATA[<p>This post is part of, and my reply to, a discussion on the <a title="Stippling Effect" href="http://scriptographer.org/forum/wish-list/stippling-effect/?pos=0#Post-4378" target="_blank">Scriptographer</a> forum regarding how to emulate <a title="Stippling" href="http://en.wikipedia.org/wiki/Stippling" target="_blank">stippling</a>. I have been thinking of a script like this for a long time &#8211; well, I&#8217;d say it&#8217;s more of a pseudo-stochastic raster than a stippler &#8211; but along the way, more and more problems have become apparent. Nevertheless, I wanted to be sure so I wrote a quick and dirty script to see how my theories would hold up.<br />
<img class="aligncenter size-large wp-image-1936" title="Iä! Iä! Cthulhu Fhtagn!" src="http://monovektor.com/wp-content/uploads/2011/12/PSR-05-590x590.png" alt="" width="590" height="590" /></p>
<p><span id="more-1922"></span></p>
<p>My way about this problem is that I divided an image into smaller squares (in this case a roughly 800 x 750 image would be divided into 32 x 32 squares).<br />
<img class="aligncenter size-large wp-image-1925" title="Iä! Iä! Shub niggurath!" src="http://monovektor.com/wp-content/uploads/2011/12/PSR-06-590x589.png" alt="" width="590" height="589" />From each square I would sample its color. Based on that colors light intensity (a value somewhere between 0-1), a predefined maximum number of dots &#8211; I used 36 &#8211; was to be multiplied and randomly placed inside that square as such;</p>
<p><em>dot distribution = {more < intensity > less}</em><br />
<img class="aligncenter size-large wp-image-1923" title="Ph'nglui Mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn." src="http://monovektor.com/wp-content/uploads/2011/12/PSR-02-590x590.png" alt="" width="590" height="590" />The result as you can see is an almost uniform distribution of some 40,000+ dots. There is virtually no contrast. If you squint your eyes you just might see some density variation, if you&#8217;re lucky! Next step was to try out a variable dot size version;</p>
<p><em>dot distribution = {more &#038; larger < intensity > less &#038; smaller}</em><br />
<img class="aligncenter size-large wp-image-1924" title="That is not dead..." src="http://monovektor.com/wp-content/uploads/2011/12/PSR-03-590x588.png" alt="" width="590" height="588" />This showed much improvement in terms of contrast but the details are absent because of the size of the sample area.<br />
Reducing the sample area would greatly increase the number of dots. Lets say I subdivide the image into 64 x 64 squares instead of 32 x 32, and the maximum number of dots per square remains the same &#8211; 36 dots &#8211; the total dot count would go from 36,864 to 147,456.<br />
In order to get some discernible details at all on a medium sized image of say 800 x 600, I wouldn&#8217;t go higher than 12 x 12 pixels per subdivision (~ 66 x 50 sample areas).<img class="aligncenter size-large wp-image-1939" title="...which can eternal lie," src="http://monovektor.com/wp-content/uploads/2011/12/PSR-07-590x590.png" alt="" width="590" height="590" />An image subdivided into 66 x 50 areas with a maximum of 36 dots per area could yield a maximum of 118,800 dots. Each dot consists of 2-4 anchors (depending on how you choose to draw them little bastards). This brings the total number of anchorpoints to somewhere between 237,600-475,200. A staggering amount and not very pleasant to work with.<br />
Finally I tried the different versions but keeping the color values.<br />
<img class="aligncenter size-large wp-image-1943" title="and with strange aeons..." src="http://monovektor.com/wp-content/uploads/2011/12/PSR-01-590x590.png" alt="" width="590" height="590" />Still no improvement on fidelity and what&#8217;s more is that the square mosaics (kinda like JPEG-artifacting) are even more evident when using colors. Not to mention when dot size is uniform and larger.<br />
<img class="aligncenter size-large wp-image-1944" title="...even death may die." src="http://monovektor.com/wp-content/uploads/2011/12/PSR-04-590x590.png" alt="" width="590" height="590" />I&#8217;d say that unless some sort of voronoi black magic is used, hell even some image quantizing using halftone dithering, it&#8217;s going to be no easy task making a memory efficient stippler in Scriptographer.<a href="http://monovektor.com/wp-content/uploads/2011/12/plant.jpg"><img class="size-large wp-image-1948 aligncenter" title="Fungi of Yuggoth?" src="http://monovektor.com/wp-content/uploads/2011/12/plant-590x310.jpg" alt="" width="590" height="310" /></a>So, until someone comes up with a working script I would suggest using <a title="Vectoraster 4" href="http://www.lostminds.com/content/show_product.php?id=vectoraster4" target="_blank">Vectoraster 4</a> instead &#8211; it&#8217;s only $25 and it comes with a ton of cool features, although it&#8217;s Mac only.<br />
<a href="http://monovektor.com/wp-content/uploads/2011/12/Cthulhu.png"><img class="aligncenter size-large wp-image-1953" title="Cthulhu by Vectoraster 4" src="http://monovektor.com/wp-content/uploads/2011/12/Cthulhu-590x590.png" alt="" width="590" height="590" /></a></p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
