<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Heatmap Generation</title>
	<atom:link href="http://www.mercuric.net/2010/08/heatmap-generation/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mercuric.net/2010/08/heatmap-generation/</link>
	<description>At least 80% post-consumer content</description>
	<lastBuildDate>Fri, 08 Jul 2011 18:15:55 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
	<item>
		<title>By: matt tag</title>
		<link>http://www.mercuric.net/2010/08/heatmap-generation/comment-page-1/#comment-2318</link>
		<dc:creator>matt tag</dc:creator>
		<pubDate>Fri, 08 Jul 2011 18:15:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.mercuric.net/?p=60#comment-2318</guid>
		<description>I&#039;m interested in playing with this code.  Do you have a sample data set that I can use? Or at least documentation of the format of the dataset file?</description>
		<content:encoded><![CDATA[<p>I&#8217;m interested in playing with this code.  Do you have a sample data set that I can use? Or at least documentation of the format of the dataset file?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Georg</title>
		<link>http://www.mercuric.net/2010/08/heatmap-generation/comment-page-1/#comment-1076</link>
		<dc:creator>Georg</dc:creator>
		<pubDate>Wed, 09 Mar 2011 08:31:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.mercuric.net/?p=60#comment-1076</guid>
		<description>sorry, typo, 26.000</description>
		<content:encoded><![CDATA[<p>sorry, typo, 26.000</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Georg</title>
		<link>http://www.mercuric.net/2010/08/heatmap-generation/comment-page-1/#comment-1075</link>
		<dc:creator>Georg</dc:creator>
		<pubDate>Wed, 09 Mar 2011 08:17:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.mercuric.net/?p=60#comment-1075</guid>
		<description>The crossover point is roughly at dotscale * heatmappoints = 6000</description>
		<content:encoded><![CDATA[<p>The crossover point is roughly at dotscale * heatmappoints = 6000</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Georg</title>
		<link>http://www.mercuric.net/2010/08/heatmap-generation/comment-page-1/#comment-1074</link>
		<dc:creator>Georg</dc:creator>
		<pubDate>Wed, 09 Mar 2011 07:48:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.mercuric.net/?p=60#comment-1074</guid>
		<description>Additional note: 

The dictionary method will get slower for samples with a large number of overlapping points, so at some point switching back to iterating over all pixels becomes faster. Switching between the two methods based on pixel distribution would provide optimal performance</description>
		<content:encoded><![CDATA[<p>Additional note: </p>
<p>The dictionary method will get slower for samples with a large number of overlapping points, so at some point switching back to iterating over all pixels becomes faster. Switching between the two methods based on pixel distribution would provide optimal performance</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Georg</title>
		<link>http://www.mercuric.net/2010/08/heatmap-generation/comment-page-1/#comment-1073</link>
		<dc:creator>Georg</dc:creator>
		<pubDate>Wed, 09 Mar 2011 07:03:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.mercuric.net/?p=60#comment-1073</guid>
		<description>Hey, 

Just wanted to shoot you an optimization to your algorithm. On a 1024x1024 bitmap with 24 sampling points, speed increase is several orders of magnitude (1.8 sec down to 0.03 sec)

(a) Use a Dictionary to store the pixel intensity values.

(b) Use AddRange() to add the dictionary values to the sort list

(c) Use an empty, transparent bitmap sized like the target image instead of passing the target image through.

(d) Cut all opacity and GetPixel calls. 
Instead, take the output image of the function (now a transparent bmp with the heat texture applied) and Draw it onto the area map image using DrawImage and and Image Attribute with a color matrix set 

ColorMatrix cm = new ColorMatrix {Matrix33 = PointColorAlpha };

imageAttribute.SetColorMatrix(cm); 

               gTarget.DrawImage(m_LayerCache,
                               new Rectangle(0, 0, size.Width, size.Height), 0, 0, m_LayerCache.Width,
                                             m_LayerCache.Height, GraphicsUnit.Pixel, m_textureAttributes);

(e) If opacity == 1, use DrawImageUnscaled instead, which is also several orders of magnitude faster than DrawImage

(f) If you want more speed and want to make the assumption that there is at least one pixel of zero intensity, only add pixels with &gt;0 intensity to the dictionary and fix the min intensity at 0. That will shave another 10-20% of the rendering times.</description>
		<content:encoded><![CDATA[<p>Hey, </p>
<p>Just wanted to shoot you an optimization to your algorithm. On a 1024&#215;1024 bitmap with 24 sampling points, speed increase is several orders of magnitude (1.8 sec down to 0.03 sec)</p>
<p>(a) Use a Dictionary to store the pixel intensity values.</p>
<p>(b) Use AddRange() to add the dictionary values to the sort list</p>
<p>(c) Use an empty, transparent bitmap sized like the target image instead of passing the target image through.</p>
<p>(d) Cut all opacity and GetPixel calls.<br />
Instead, take the output image of the function (now a transparent bmp with the heat texture applied) and Draw it onto the area map image using DrawImage and and Image Attribute with a color matrix set </p>
<p>ColorMatrix cm = new ColorMatrix {Matrix33 = PointColorAlpha };</p>
<p>imageAttribute.SetColorMatrix(cm); </p>
<p>               gTarget.DrawImage(m_LayerCache,<br />
                               new Rectangle(0, 0, size.Width, size.Height), 0, 0, m_LayerCache.Width,<br />
                                             m_LayerCache.Height, GraphicsUnit.Pixel, m_textureAttributes);</p>
<p>(e) If opacity == 1, use DrawImageUnscaled instead, which is also several orders of magnitude faster than DrawImage</p>
<p>(f) If you want more speed and want to make the assumption that there is at least one pixel of zero intensity, only add pixels with &gt;0 intensity to the dictionary and fix the min intensity at 0. That will shave another 10-20% of the rendering times.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zebranky</title>
		<link>http://www.mercuric.net/2010/08/heatmap-generation/comment-page-1/#comment-187</link>
		<dc:creator>Zebranky</dc:creator>
		<pubDate>Fri, 20 Aug 2010 03:54:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.mercuric.net/?p=60#comment-187</guid>
		<description>Interesting.  I rather like the &quot;classic&quot; colors, and I figured desaturating the background and tweaking the opacity is sufficient for most cases, but an arbitrary bitmap might be a good next step.

Feel free to link!  As I said, there&#039;s no sense in reinventing the wheel more than a few times :)</description>
		<content:encoded><![CDATA[<p>Interesting.  I rather like the &#8220;classic&#8221; colors, and I figured desaturating the background and tweaking the opacity is sufficient for most cases, but an arbitrary bitmap might be a good next step.</p>
<p>Feel free to link!  As I said, there&#8217;s no sense in reinventing the wheel more than a few times <img src='http://www.mercuric.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Georg</title>
		<link>http://www.mercuric.net/2010/08/heatmap-generation/comment-page-1/#comment-186</link>
		<dc:creator>Georg</dc:creator>
		<pubDate>Fri, 20 Aug 2010 03:25:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.mercuric.net/?p=60#comment-186</guid>
		<description>Hey,

Percentile mapping is the way to go - I ran into the same problem, e.g. writing the code from scratch, and ended up with a similar solution.

I&#039;m using an indexed bitmap to map color to weight on the map, which has the benefit of being able to swap that bitmap out for different color schemes - which is useful when rendering on top of in-game minimap images of different color.

Mind if I link your article?

-- Georg</description>
		<content:encoded><![CDATA[<p>Hey,</p>
<p>Percentile mapping is the way to go &#8211; I ran into the same problem, e.g. writing the code from scratch, and ended up with a similar solution.</p>
<p>I&#8217;m using an indexed bitmap to map color to weight on the map, which has the benefit of being able to swap that bitmap out for different color schemes &#8211; which is useful when rendering on top of in-game minimap images of different color.</p>
<p>Mind if I link your article?</p>
<p>&#8211; Georg</p>
]]></content:encoded>
	</item>
</channel>
</rss>
