{"id":21658,"library":"opensimplex","title":"opensimplex","description":"OpenSimplex is a noise generation function like Perlin or Simplex noise, but better. Current version 0.4.5.1. Released sparingly, with minor fixes.","status":"active","version":"0.4.5.1","language":"python","source_language":"en","source_url":"https://github.com/lmas/opensimplex","tags":["noise","procedural-generation","opensimplex"],"install":[{"cmd":"pip install opensimplex","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"","wrong":null,"symbol":"OpenSimplex","correct":"from opensimplex import OpenSimplex"}],"quickstart":{"code":"from opensimplex import OpenSimplex\nimport matplotlib.pyplot as plt\n\nseed = 42\ngen = OpenSimplex(seed=seed)\n\nsize = 10\nnoise = [[gen.noise2d(x / size, y / size) for x in range(size)] for y in range(size)]\nplt.imshow(noise, cmap='gray')\nplt.show()","lang":"python","description":"Generate 2D noise and display with matplotlib."},"warnings":[{"fix":"Use `from opensimplex import OpenSimplex` and create an instance: `gen = OpenSimplex(seed=...)` then call `gen.noise2d(x, y)`.","message":"In v0.4+, API changed from function-based (`opensimplex.noise2d(x, y)`) to class-based (`OpenSimplex` object). Old `opensimplex.noise2d` etc. no longer exist.","severity":"breaking","affected_versions":">=0.4"},{"fix":"Replace `opensimplex.noise2d(x, y)` with `OpenSimplex(seed).noise2d(x, y)`.","message":"Direct module-level functions `opensimplex.noise2d`, `opensimplex.noise3d`, `opensimplex.noise4d` are removed. Use the class-based API.","severity":"deprecated","affected_versions":">=0.4"},{"fix":"Always pass an integer seed: `OpenSimplex(seed=42)`.","message":"The `seed` parameter must be an integer. Passing a non-integer (e.g. string) may cause TypeError or unexpected behavior.","severity":"gotcha","affected_versions":"all"},{"fix":"If you need a [0,1] range, apply: `value = (noise + 1) / 2`.","message":"OpenSimplex 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`.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Use class-based API: `from opensimplex import OpenSimplex; gen = OpenSimplex(seed=0); gen.noise2d(x, y)`.","cause":"Using old function-based API after upgrading to v0.4+.","error":"AttributeError: module 'opensimplex' has no attribute 'noise2d'"},{"fix":"Do not reuse the name `opensimplex` as a variable. Use a different name for the instance.","cause":"Accidentally assigned `opensimplex` to an integer variable or overwritten the import.","error":"TypeError: 'int' object is not callable"},{"fix":"Ensure seed is an integer: `OpenSimplex(seed=int(seed_value))`.","cause":"Passing a non-integer seed (e.g., float or string) to OpenSimplex constructor.","error":"ValueError: seed must be an integer"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}