Registry / ai-ml / opensimplex

opensimplex

JSON →
library0.4.5.1pypypi✓ verified 84d ago

OpenSimplex is a noise generation function like Perlin or Simplex noise, but better. Current version 0.4.5.1. Released sparingly, with minor fixes.

pip install opensimplex
INSTALL
IMPORT
SIG · OPENSIMPLEX
O
opensimplex
ai-mlpythonv0.4.5.1
Install
4.6s avg
Import
283ms
Disk
89MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.4.5.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.266s · 89.7MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 4.6s · import 0.300s · 86MB
89MB installed
● package 89MB
Code
Verified usage

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

OpenSimplex
from opensimplex import OpenSimplex

Generate 2D noise and display with matplotlib.

from opensimplex import OpenSimplex import matplotlib.pyplot as plt seed = 42 gen = OpenSimplex(seed=seed) size = 10 noise = [[gen.noise2d(x / size, y / size) for x in range(size)] for y in range(size)] plt.imshow(noise, cmap='gray') plt.show()
Debug
Known issues
breakingIn v0.4+, API changed from function-based (`opensimplex.noise2d(x, y)`) to class-based (`OpenSimplex` object). Old `opensimplex.noise2d` etc. no longer exist.
fix
Use `from opensimplex import OpenSimplex` and create an instance: `gen = OpenSimplex(seed=...)` then call `gen.noise2d(x, y)`.
affects: >=0.4
deprecatedDirect module-level functions `opensimplex.noise2d`, `opensimplex.noise3d`, `opensimplex.noise4d` are removed. Use the class-based API.
fix
Replace `opensimplex.noise2d(x, y)` with `OpenSimplex(seed).noise2d(x, y)`.
affects: >=0.4
gotchaThe `seed` parameter must be an integer. Passing a non-integer (e.g. string) may cause TypeError or unexpected behavior.
fix
Always pass an integer seed: `OpenSimplex(seed=42)`.
affects: all
gotchaOpenSimplex noise output range is approximately [-1, 1], but not guaranteed to hit exactly -1 or 1. Scaling to [0,1] often done via `(noise + 1) / 2`.
fix
If you need a [0,1] range, apply: `value = (noise + 1) / 2`.
affects: all
Errors
Common errors & fixes
AttributeError: module 'opensimplex' has no attribute 'noise2d'
Using old function-based API after upgrading to v0.4+.
fix
Use class-based API: `from opensimplex import OpenSimplex; gen = OpenSimplex(seed=0); gen.noise2d(x, y)`.
TypeError: 'int' object is not callable
Accidentally assigned `opensimplex` to an integer variable or overwritten the import.
fix
Do not reuse the name `opensimplex` as a variable. Use a different name for the instance.
ValueError: seed must be an integer
Passing a non-integer seed (e.g., float or string) to OpenSimplex constructor.
fix
Ensure seed is an integer: `OpenSimplex(seed=int(seed_value))`.
Upgrade
Version history
0.4.5.1latest on PyPI · released May 1, 2024
Audit
Dependencies

No dependency data recorded yet.

Agent activity
11 hits · last 30 days
node
8
Resources
opensimplex — pip install opensimplex · libregistry