title: GD/PHP heatmaps on geographical background
body: <p>I am trying to reproduce the heatmap effect Bungie uses to show kills/deaths on specific halo 3 maps using PHP and GD.  (Example: <a href="http://www.bungie.net/stats/halo3/heatmapstats.aspx?player=gatts007" rel="nofollow noreferrer">http://www.bungie.net/stats/halo3/heatmapstats.aspx?player=gatts007</a> - pick a map like "Guardian" for a better example.)</p>
  
  <p>I have all the data and background map images from my game, but I am having trouble coming up with a way to actually get the gradient to work correctly.</p>
  
  <p>Here is my process so far:</p>
  
  <ol>
  <li>On a pure black background: For each
  kill Draw white gradient-translucent circle
  (solid near the middle, 100%
  translucent at the edge) at that
  location on the map.  (This is
  working well.)</li>
  <li>Now replace any solid
  black pixel with a pure translucent
  pixel.</li>
  <li>Map a color scale to the remaining pixels to get the heat map effect. (Use gray scale value to map to a color.)</li>
  <li>Place this created image on top of the real map background.</li>
  </ol>
  
  <p>I am having problems with steps 2 and 3.  Does anyone have some good examples of these steps?  Or better yet, a process that will give better results?</p>
  
  <p>Thanks!</p>