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 int32s ranging from -1 to 1.Please note that the variable tileSize equals 1024 / resolutieX. This is in case I want to use a lower resolution Perlin noise. 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 < resolutieX; x++)        {            for (int y = 0; y < resolutieY; y++)            {                perlinArray[x, y] = perlinMap.GetValue(x / sample, y / sample, 1d);            }        }        draw(perlinArray);        textBox12.Text = sw.ElapsedMilliseconds.ToString() + ms;        sw.Reset();    }public void draw(double[,] array)    {        Bitmap afbeelding = new Bitmap(1024, 1024);        Color color;        int tileSize = 1024 / resolutieY;        for (int y = 1; y < resolutieY; y++)        {            for (int x = 1; x < resolutieX; x++)            {                if (array[x, y] <= -0.2)                    color = Color.DarkBlue;                if (array[x, y] <= 0)                    color = Color.DarkBlue;                else if (array[x, y] <= 0.1)                    color = Color.Blue;                else if (array[x, y] <= 0.2)                    color = Color.Beige;                else if (array[x, y] <= 0.22)                    color = Color.LightGreen;                else if (array[x, y] <= 0.40)                    color = Color.Green;                else if (array[x, y] <= 0.75)                    color = Color.DarkGreen;                else if (array[x, y] <= 0.8)                    color = Color.LightSlateGray;                else if (array[x, y] <= 0.9)                    color = Color.Gray;                else if (array[x, y] <= 1)                    color = Color.DarkSlateGray;                else                    color = Color.DarkSlateGray;                //  color = Color.FromArgb(255);                for (int i = 0; i < tileSize; i++)                {                    for (int j = 0; j < tileSize; j++)                    {                        afbeelding.SetPixel(((x - 1) * tileSize) + i, ((y - 1) * tileSize) + j, color);                    }                }            }        }        pictureBox1.Image = afbeelding;    }Should I start using Simplex noise? Or am I just missing something obvious here?
Is there a way to optimise my Perlin noise?
c#;optimization;array;image