noise generators (forked from: Krita user community?)

Matthew Woehlke mw_triad at users.sourceforge.net
Sat Feb 23 04:41:26 CET 2008


So, perlin noise is nice, but since I'm thinking about other noise 
generators... I'm tinkering with a plasma generator (this one isn't 
"strictly" procedural, although it might be possible to come close... 
not that it should matter so much for krita the way it would in a 3d 
render engine), and wondering if there would be interest in adding it to 
krita at some point.

(There is a quirk in the generator that it can only make images that are 
integer multiples of the seed spacing, so it potentially has to 
over-generate... but the generated image, if not cropped, is tilable :-).)

All versions of this algorithm are based on an initial "seed grid", much 
like perlin, that is then filled in using some algorithm. Currently the 
KDE version only supports a "dumb" tesseral algorithm that fills one 
cell at a time, independently (and is thusly a candidate for massive 
multi-processing), which is why the no-jitter image is so obviously 
block-like. A better approach I have uses a multi-pass fill that 
recursively fills the midpoint of the largest-empty-space-containing 
quads (this is necessarily multi-pass rather than tesseral because one 
of the three stages for each pass depends on the nodes belonging to 
neighbor cells). Currently I only have a VB implementation from many 
years ago, but it still runs, so I can show pretty pictures. A benefit 
of either algorithm is that they could cut passes short, i.e. a 50% 
reduction in image dimensions (e.g. in a preview) results in a 75% 
reduction in calculation.

The KDE version uses what is effectively an infinite-octave (or at 
least, always down to whatever octave has a 1px frequency) multi-pass 
where the opacity of each octave is O(n) = j * d**n, which lends itself 
mostly to either traditional octave-passes, or octave-passes with 
greater bias given to the higher octaves, effectively adding traditional 
noise to the low octaves. The VB version (apparently) does something 
quite different that more closely resembles an output filter (or the 
aforementioned "stucco" algorithm) or a low-amplitude phase pass, and 
looks much more "fractal".

My next goal after implementing the multi-pass fill algorithm is to

Something I would eventually like to get working is a fill algorithm for 
non-rectangular regiions; at first quads, then triangles. At that point, 
using a Fermat spiral[1] for the seeding becomes an interesting 
possibility. No idea if I'd ever get around to any of that, though.

Pretty images at 
http://picasaweb.google.com/mw.triad/PlasmaGeneratorSamples.

(The 'reuse seed' option in the VB version is apparently broken, so I 
don't have similar images to show, also it just uses a dumb PRNG, not a 
procedural one.)

1: http://en.wikipedia.org/wiki/Fermat%27s_spiral

-- 
Matthew
People say I'm going insane. I say, "what do you mean, 'going'?".



More information about the kimageshop mailing list