Registry / data / perlin-noise

perlin-noise

JSON →
library1.14pypypi✓ verified 84d ago

A Python implementation of Perlin Noise with support for unlimited coordinate space. Current version 1.14, requires Python >=3.9,<3.13. Released under MIT license. Active development with periodic updates.

pip install perlin-noise
INSTALL
IMPORT
SIG · PERLIN-NOISE
P
perlin-noise
datapythonv1.14
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

PerlinNoise
from perlin_noise import PerlinNoise
Correct import path (note the underscore in the module name).
PerlinNoise
from perlin_noise import PerlinNoise
from perlin-noise import PerlinNoise
Hyphens in package name are not valid in Python import statements; use underscores.

Create a seeded PerlinNoise object and generate a 2D noise map using a grid of coordinates.

from perlin_noise import PerlinNoise import numpy as np # Create a noise object with seed 10 noise = PerlinNoise(octaves=4, seed=10) # Generate 2D noise (e.g., 10x10 grid) freq = 16 # Adjust for desired detail xp, yp = np.mgrid[0:10, 0:10] / freq pic = np.array([[noise([x, y]) for y in yp[0]] for x in xp[:,0]]) print(pic.shape) # (10,10)
Debug
Known issues
breakingIn version 1.0, the seed parameter was named 'seed' but was renamed to 'random_seed' in a later release (<1.10). If using older code, update to 'seed' or check the version.
fix
Use 'seed' for current versions; or pin to older versions if needed.
affects: <1.10
gotchaThe noise output values are not normalized to [0,1] by default; they typically range around [-1,1]. Some users expect a different range.
fix
Scale output manually if needed: e.g., (value + 1) / 2 for [0,1].
affects: all
deprecatedThe 'PerlinNoise2D' and 'PerlinNoise3D' classes (from older versions) are deprecated; use the general 'PerlinNoise' class with appropriate coordinate dimensions.
fix
Use 'from perlin_noise import PerlinNoise' and pass [x,y] or [x,y,z].
affects: >=1.12
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'perlin_noise'
Package name uses hyphen (perlin-noise) but import requires underscore.
fix
Install with 'pip install perlin-noise' and import as 'from perlin_noise import PerlinNoise'.
TypeError: argument of type 'int' is not iterable
Passing a single integer as coordinate instead of a list/tuple.
fix
Use noise([x]) for 1D or noise([x, y]) for 2D.
AttributeError: module 'perlin_noise' has no attribute 'PerlinNoise2D'
Using deprecated class name removed in version 1.12+.
fix
Update code to use 'from perlin_noise import PerlinNoise' and pass coordinates as list.
Upgrade
Version history
1.14latest on PyPI · released Apr 12, 2025
Audit
Dependencies
numpyrequiredRequired for array operations and noise generation
Agent activity
2 hits · last 30 days
node
2
Resources
perlin-noise — pip install perlin-noise · libregistry