title: Is there a more effecient way to calculate and use Perlin noise?
body: <p>I just started using Perlin noise a few days ago, and the results look quite good. But it takes over 3 seconds to calculate and draw a 1024x1024 bitmap of said noise. I use an array of 1024x1024 to store int32's ranging from -1 to 1.</p>
  
  <p>The code that creates the array of Perlin noise:</p>
  
  <pre><code> private void button1_Click(object sender, EventArgs e)
      {
          sw.Start();
          LibNoise.Perlin perlinMap = new LibNoise.Perlin();
          perlinMap.Lacunarity = lacunarity + 0.01d;
          perlinMap.NoiseQuality = LibNoise.NoiseQuality.High;
          perlinMap.OctaveCount = octaveCount;
          perlinMap.Persistence = persistence;
          perlinMap.Frequency = frequency;
          perlinMap.Seed = 1024;
  
          if (radioButton1.Checked)
              perlinMap.NoiseQuality = LibNoise.NoiseQuality.Low;
          else if (radioButton2.Checked)
              perlinMap.NoiseQuality = LibNoise.NoiseQuality.Standard;
          else if (radioButton3.Checked)
              perlinMap.NoiseQuality = LibNoise.NoiseQuality.High;
  
          double sample = trackBar6.Value * 10;
  
          double[,] perlinArray = new double[resolutieX, resolutieY];
          for (int x = 0; x &lt; resolutieX; x++)
          {
              for (int y = 0; y &lt; resolutieY; y++)
              {
                  perlinArray[x, y] = perlinMap.GetValue(x / sample, y / sample, 1d);
              }
          }
          draw(perlinArray);
          textBox12.Text = sw.ElapsedMilliseconds.ToString() + "ms";
          sw.Reset();
      }
  </code></pre>
  
  <p>The code that draws out the perlin noise:</p>
  
  <pre><code> public void draw(double[,] array)
      {
          Bitmap afbeelding = new Bitmap(1024, 1024);
          Color color;
          int tileSize = 1024 / resolutieY;
          for (int y = 1; y &lt; resolutieY; y++)
          {
              for (int x = 1; x &lt; resolutieX; x++)
              {
                  if (array[x, y] &lt;= -0.2)
                      color = Color.DarkBlue;
                  if (array[x, y] &lt;= 0)
                      color = Color.DarkBlue;
                  else if (array[x, y] &lt;= 0.1)
                      color = Color.Blue;
                  else if (array[x, y] &lt;= 0.2)
                      color = Color.Beige;
                  else if (array[x, y] &lt;= 0.22)
                      color = Color.LightGreen;
                  else if (array[x, y] &lt;= 0.40)
                      color = Color.Green;
                  else if (array[x, y] &lt;= 0.75)
                      color = Color.DarkGreen;
                  else if (array[x, y] &lt;= 0.8)
                      color = Color.LightSlateGray;
                  else if (array[x, y] &lt;= 0.9)
                      color = Color.Gray;
                  else if (array[x, y] &lt;= 1)
                      color = Color.DarkSlateGray;
                  else
                      color = Color.DarkSlateGray;
  
                  //  color = Color.FromArgb(255);
  
                  for (int i = 0; i &lt; tileSize; i++)
                  {
                      for (int j = 0; j &lt; tileSize; j++)
                      {
                          afbeelding.SetPixel(((x - 1) * tileSize) + i, ((y - 1) * tileSize) + j, color);
                      }
                  }
  
              }
          }
  
          pictureBox1.Image = afbeelding;
      }
  </code></pre>
  
  <p>Should I be using Simplex noise? Or am I missing something here?</p>