API reference
2D Perlin noise
- perlin_numpy.generate_perlin_noise_2d(shape, res, tileable=(False, False), interpolant=<function interpolant>, rng=None)
Generate a single octave of 2-dimensional perlin noise.
- Parameters:
shape (tuple[int, int]) – The shape of the generated array. This must be a multple of res.
res (tuple[int, int]) – The number of periods of noise to generate along each axis.
tileable (tuple[bool, bool]) – If the noise should be tileable along each axis. 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_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.
- Parameters:
shape (tuple[int, int]) – The shape of the generated array. This must be a multiple of
lacunarity**(octaves-1)*res.res (tuple[int, int]) – The number of periods of noise to generate along each axis.
octaves (int) – The number of octaves in the noise. Defaults to 1.
persistence (float) – The scaling factor between two octaves.
lacunarity (int) – The frequency factor between two octaves.
tileable (tuple[bool, bool]) – If the noise should be tileable along each axis. 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.
3D Perlin noise
- perlin_numpy.generate_perlin_noise_3d(shape, res, tileable=(False, False, False), interpolant=<function interpolant>, rng=None)
Generate a single octave of 3-dimensional perlin noise.
- Parameters:
shape (tuple[int, int, int]) – The shape of the generated array. This must be a multiple of res.
res (tuple[int, int, int]) – The number of periods of noise to generate along each axis.
tileable (tuple[bool, bool, bool]) – If the noise should be tileable along each axis. 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.
- 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.
- Parameters:
shape (tuple[int, int, int]) – The shape of the generated array. This must be a multiple of
lacunarity**(octaves-1)*res.res (tuple[int, int, int]) – The number of periods of noise to generate along each axis.
octaves (int) – The number of octaves in the noise. Defaults to 1.
persistence (float) – The scaling factor between two octaves.
lacunarity (int) – The frequency factor between two octaves.
tileable (tuple[bool, bool, bool]) – If the noise should be tileable along each axis. 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.