title: Create a bitmap file from random data
body: <p>How can I convert a 2 dimensional array of random data to a bitmap?  What I am doing is creating a height map using the diamond square algorithm - which works just fine - but I want to be able to visualize the results for testing and debugging purposes.  The best way to do this I think is by generating the results as a grayscale bitmap. </p>
  
  <p>I have seen many examples of reading and writing bitmap data (ie reading an image to a bytebuffer and back again) but nothing that would explain how to take random data and create an image with it.  All I want to do is take each value of my array and convert it to a grayscale pixel.  </p>
  
  <p>For example: </p>
  
  <pre><code>data[0][0] = 98, then pixel (0,0) would be RGB (98,98,98)
  data[0][1] = 220, then pixel (0,1) would be RGB (220,220,220)
  </code></pre>
  
  <p>My random values are already between 0 and 255 inclusive.  </p>