Perlin noise in ImageMagick is simply:
Code: Select all
-size AxB xc:gray(50%)
+noise NOISE_TYPE
-filter FILTER_TYPE
-resize CxD!
This defines the initial grid, populates it with noise, and interpolates between grid values for the final image. The noise is coherent, but not self-similar.
This could be coded in C as a single IM operation, perhaps involving large pre-built look-up tables as suggested by Ken Perlin, so it would be very fast, and run on GPUs etc. An interested person (not me) might take up the challenge.
The next stage is to create multiple scales of noise and add or blend them, making fractal noise which is coherent and self-similar. This would have controls for the relative weights of the octaves, whether to take absolute values of the noise (Perlin calls this "turbulence", but I think it is different to Adobe's "turbulence"), and so on. Fred has published a script for this. I have my own unpublished script. Adobe's version has extra controls, eg to rotate octaves.
This could also be coded as an IM operation.
The next stage is to combine fractal noise with other image operations, eg by using them as displacement maps, as inputs to CLUTs and so on. I intend to write a page on this with a variety of examples. I think this is what Adobe have done with their "Turbulent Noise effect". Some of Adobe's controls have simple equivalents in IM, for example Adobe's "invert" is IM's "-negate". Others such as "swirls" are more complex.
For animation, the grid noise values can be saved from one frame to the next, slightly changed, rather than re-generated from scratch. Noise is added to noise. This can be scaled, so the low-frequency octaves change more slowly than high-frequency noise, which mimics turbulent fluid flow. I have done some (unpublished) work on this, using IM in scripts.