perlin-numpy API reference

perlin_numpy.generate_fractal_noise_2d(shape, res, octaves=1, persistence=0.5, lacunarity=2, tileable=(False, False), interpolant=<function interpolant>, rng=None)

Generate a 2D numpy array of fractal noise.

Args:
shape: The shape of the generated array (tuple of two ints).

This must be a multiple of lacunarity**(octaves-1)*res.

res: The number of periods of noise to generate along each

axis (tuple of two ints). Note shape must be a multiple of (lacunarity**(octaves-1)*res).

octaves: The number of octaves in the noise. Defaults to 1. persistence: The scaling factor between two octaves. lacunarity: The frequency factor between two octaves. tileable: If the noise should be tileable along each axis

(tuple of two bools). Defaults to (False, False).

interpolant: The, interpolation function, defaults to

t*t*t*(t*(t*6 - 15) + 10).

rng: A NumPy random number generator for reproducible randomness,

if desired.

Returns:

A numpy array of fractal noise and of shape shape generated by combining several octaves of perlin noise.

Raises:
ValueError: If shape is not a multiple of

(lacunarity**(octaves-1)*res).

perlin_numpy.generate_fractal_noise_3d(shape, res, octaves=1, persistence=0.5, lacunarity=2, tileable=(False, False, False), interpolant=<function interpolant>, rng=None)

Generate a 3D numpy array of fractal noise.

Args:
shape: The shape of the generated array (tuple of three ints).

This must be a multiple of lacunarity**(octaves-1)*res.

res: The number of periods of noise to generate along each

axis (tuple of three ints). Note shape must be a multiple of (lacunarity**(octaves-1)*res).

octaves: The number of octaves in the noise. Defaults to 1. persistence: The scaling factor between two octaves. lacunarity: The frequency factor between two octaves. tileable: If the noise should be tileable along each axis

(tuple of three bools). Defaults to (False, False, False).

interpolant: The, interpolation function, defaults to

t*t*t*(t*(t*6 - 15) + 10).

rng: A NumPy random number generator for reproducible randomness,

if desired.

Returns:

A numpy array of fractal noise and of shape shape generated by combining several octaves of perlin noise.

Raises:
ValueError: If shape is not a multiple of

(lacunarity**(octaves-1)*res).

perlin_numpy.generate_perlin_noise_2d(shape, res, tileable=(False, False), interpolant=<function interpolant>, rng=None)

Generate a 2D numpy array of perlin noise.

Args:
shape: The shape of the generated array (tuple of two ints).

This must be a multple of res.

res: The number of periods of noise to generate along each

axis (tuple of two ints). Note shape must be a multiple of res.

tileable: If the noise should be tileable along each axis

(tuple of two bools). Defaults to (False, False).

interpolant: The interpolation function, defaults to

t*t*t*(t*(t*6 - 15) + 10).

rng: A NumPy random number generator for reproducible randomness,

if desired.

Returns:

A numpy array of shape shape with the generated noise.

Raises:

ValueError: If shape is not a multiple of res.

perlin_numpy.generate_perlin_noise_3d(shape, res, tileable=(False, False, False), interpolant=<function interpolant>, rng=None)

Generate a 3D numpy array of perlin noise.

Args:
shape: The shape of the generated array (tuple of three ints).

This must be a multiple of res.

res: The number of periods of noise to generate along each

axis (tuple of three ints). Note shape must be a multiple of res.

tileable: If the noise should be tileable along each axis

(tuple of three bools). Defaults to (False, False, False).

interpolant: The interpolation function, defaults to

t*t*t*(t*(t*6 - 15) + 10).

rng: A NumPy random number generator for reproducible randomness,

if desired.

Returns:

A numpy array of shape shape with the generated noise.

Raises:

ValueError: If shape is not a multiple of res.