Graphics by GIMP Logo

Valid HTML 4.01!


Documentation : Developers

Note: You don't need to read nor understand this section to use the plugin from within the GIMP; this section is only useful if you're actually planning to develop a script or another plugin that calls the Felimage Noise Plugin.

The plugin registers itself in the Gimp PDB as plug_in_fimg_noise.

The function expects three arguments:
  1. An image where the render will take place.
  2. A drawable onto which the plugin will do the actual render. (The drawable must belong to the image)
  3. A configuration string, with all the parameters. Given the large number of configurable options the plugin has, instead of passing them to the plugin each as an argument to the function, they are passed as a string.
The configuration string is a list of "key : value" pairs, each separated by commas.  Colons and commas can only be used to separate fields. Spaces are allowed, and sometimes may actually be required, for example if the name of a gradient contains a space. All parameters are optional. If a parameter is not specified, the default value is used.

For example, a valid configuration string would be:

"gradient: Horizon 1, size_x: 50.5, size_y: 10.1"

IMPORTANT: Floats must be specified with a period as decimal separator ; that is, no decimal commas!  In Python this is normally not a problem as all python programs start in the "C" locale.

A simple python script using that configuration string:

from gimpfu import *

img = pdb.gimp_image_new(640,480,0)
layer = pdb.gimp_layer_new(img, 640,480, 0, "a layer", 100, 0)
pdb.plug_in_fimg_noise(img,layer,"gradient: Horizon 1, size_x: 50.5, size_y: 10.1")

Here's a table with the valid parameters:

Parameter Description Type Values Default Notes
seed   int   (not specified) If seed is not specified, a random value is picked every time
size_x Horizontal feature size float >=1 10  
size_y Vertical feature size float >=1 10  
octaves Number of octaves float 1 .. 15 3  
lacunarity Lacunarity value float 1 .. 10 2  
hurst Hurst exponent float 0 .. 2 0.5  
frequency   float 0.001 .. 1000 1  
shift How much is the color sequence shifted (100 is a full cycle) float 0 .. 100 0.0  
mapping Name of the mapping to use text planar, tileable, spherical planar  
basis Name of the basis function text lattice_noise, lattice_turbulence, sparse_noise, sparse_turbulence,
skin, puffy, fractured, crystals, galvanized
color_src Where the colors are taken from text fg_bg, gradient, channels, warp fg_bg This one doesn't need to be specified, as it is selected automatically depending on the presence of other options
reverse Whether the color sequence is reversed or not boolean yes, true, false, no no  
function How is the color sequence repeated text ramp, triangle, sine, half_sine ramp  
phase Noise phase (click here for more info). float   (not specified) Specifying a phase value usually slows down the calculation.
multifractal How the octaves are blended together (click here for more info). text fbm, multifractal, inv_multifractal fbm  
channel_r Red (color images) or Luminosity (if in grayscale) text 1, inv_1,  2, inv_2, 3,  inv_3, 4, inv_4, light, mid, dark 1 Specifying any of these sets the color_src to "channels"
channel_g Green channel source text 1
channel_b Blue channel source text 1
channel_a Alpha channel source text 1, inv_1, 2, inv_2, 3, inv_3, 4, inv_4,, solid 1
warp_size_x How much the image is distorted horizontally float >=1 10 Specifying any of these sets the color_src to "warp"
warp_size_y How much the image is distorted vertically float >=1 10
warp_caustics Magnitude of the caustics float -1 .. 1 0
warp_quality Algorithm to use when warping the image text faster, better faster
edge_action What to do when sampling outside the image extents text warp, smear, black, background warp  
gradient Name of the gradient to use text (any gradient name) (the first one found) Specifying this sets color_src to "gradient"
pinch Click here for details float -1 .. 1 0  
bias float -1 .. 1 0  
gain float -1 .. 1 0