About Perlin Noise
Perlin noise is a type of gradient noise developed by Ken Perlin in 1983 as a result of his frustration with the “machinelike” look of computer graphics at the time. (From Wikipedia)
In general, the function of perlin noise is to make a noise which looks more natural. It is often used in games and visual media such as the generation of terrain and fires.
The realization of perlin noise consists of the following steps:
 Generate a random value and gradient for each integral point.
 For points between the points, use interpolation to generate the value.
 Using ease curve to make the result looks more natural.
Code
1 

1  var ctx = canvas.getContext('2d'); 
1  </script> 
What I’ve done
I choose HTML + JavaScript to write the code so you can easily see what is the result by copying the code into an html file and see the result.
Instead of the array perlin used in his essay, I generate the value and gradient in a totally random way. This may take more spaces, but the result is better and looks more natural.
Also, I use a recursion way to write the code so it can be extended to any dimension, not only 2D, you can generate a 3D, 4D… perlin noise. Of course, I generate a 2D perlin noise as the example for the limitation of 100 lines.
Result
The original perlin noise looks like below
https://accrt.github.io/personalHTML/examples/perlin/test_origin.html:when we accumulate the original result of perlin noise, which is a fractal, we can see the result below
https://accrt.github.io/personalHTML/examples/perlin/test_fractral.html:
https://accrt.github.io/personalHTML/examples/perlin/test_fractral2.html:If using sin to the accumulation result, that will be
https://accrt.github.io/personalHTML/examples/perlin/test_sin.html:
This is just what I wrote in the code.An easy way to make the picture looks like fire is using reflex. You can reflex the black to white color to the color strip showed below.
https://accrt.github.io/personalHTML/examples/perlin/test_sin_fire.html:
https://accrt.github.io/personalHTML/examples/perlin/test_fractral2_fire.html:Many wood texture are generated by perlin noise as well
https://accrt.github.io/personalHTML/examples/perlin/test_wood.html:Of course, when it comes to a 3D perlin noise you can use one dimension as time line, to make the texture changes with time
https://accrt.github.io/personalHTML/examples/perlin/test_wood_changes.html.
Some other things
I have put this page on my friend’s personal blog. You can see it on
A realization of Perlin Noise
Source Pages
http://flafla2.github.io/2014/08/09/perlinnoise.html
https://en.wikipedia.org/wiki/Perlin_noise