fractal noise particular

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: fractal noise particular

Post by snibgo »

Thanks for the links.

Perlin noise in ImageMagick is simply:

Code: Select all

-size AxB xc:gray(50%)
+noise NOISE_TYPE
-filter FILTER_TYPE
-resize CxD!
Where AxB is the number of grid points, NOISE_TYPE is Gaussian or whatever you want, and CxD is the final image size. The filter line is optional, and defines the interpolation type.

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.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: fractal noise particular

Post by fmw42 »

snibgo wrote:Others such as "swirls" are more complex.
This may be equivalent to my disperse script?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: fractal noise particular

Post by snibgo »

fmw42 wrote:This may be equivalent to my disperse script?
From a quick look at your page http://www.fmwconcepts.com/imagemagick/ ... /index.php and script, yes, that seems likely, if you use fractal noise instead of "+noise Random" for your $tmp0 displacement map.
snibgo's IM pages: im.snibgo.com
manuel_songokuh
Posts: 8
Joined: 2015-08-27T16:24:22-07:00
Authentication code: 1151

Re: fractal noise particular

Post by manuel_songokuh »

@fmw42
do you have news?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: fractal noise particular

Post by fmw42 »

manuel_songokuh wrote:@fmw42
do you have news?
News about what?
Post Reply