Skip to main content

OpenSimplex Noise

OpenSimplex noise is an n-dimensional gradient noise function that was developed in order to overcome the patent-related issues surrounding Simplex noise, while continuing to also avoid the visually-significant directional artifacts characteristic of Perlin noise.

This is merely a python port of Kurt Spencer’s original code, released to the public domain, and neatly wrapped up in a package.

USAGE

Initialization:

>>> from opensimplex import OpenSimplex
>>> tmp = OpenSimplex()
>>> print (tmp.noise2d(x=10, y=10))
0.732051569572

Optionally, the class accepts a seed value:

>>> tmp = OpenSimplex(seed=1)
>>> print (tmp.noise2d(x=10, y=10))
-0.4790979022623557

The seed must be a valid python number. It’s used internally to generate some permutation arrays, which is used for the noise generation.

If it isn’t provided the class will default to use 0 as the seed.

Available class methods:

OpenSimplex.noise2d(x, y)

Generate 2D OpenSimplex noise from X,Y coordinates.

OpenSimplex.noise3d(x, y, z)

Generate 3D OpenSimplex noise from X,Y,Z coordinates.

OpenSimplex.noise4d(x, y, z, w)

Generate 4D OpenSimplex noise from X,Y,Z,W coordinates.

FAQ

  • Is this relevantly different enough to avoid any real trouble with the original patent?

    If you read the patent claims:

    Claim #1 talks about the hardware-implementation-optimized gradient generator. Most software implementations of Simplex Noise don’t use this anyway, and OpenSimplex Noise certainly doesn’t.

    Claim #2(&3&4) talk about using (x’,y’,z’)=(x+s,y+s,z+s) where s=(x+y+z)/3 to transform the input (render space) coordinate onto a simplical grid, with the intention to make all of the “scissor-simplices” approximately regular. OpenSimplex Noise (in 3D) uses s=-(x+y+z)/6 to transform the input point to a point on the Simplectic honeycomb lattice so that the simplices bounding the (hyper)cubes at (0,0,..,0) and (1,1,…,1) work out to be regular. It then mathematically works out that s=(x+y+z)/3 is needed for the inverse transform, but that’s performing a different (and opposite) function.

    Claim #5(&6) are specific to the scissor-simplex lattice. Simplex Noise divides the (squashed) n-dimensional (hyper)cube into n! simplices based on ordered edge traversals, whereas OpenSimplex Noise divides the (stretched) n-dimensional (hyper)cube into n polytopes (simplices, rectified simplices, birectified simplices, etc.) based on the separation (hyper)planes at integer values of (x’+y’+z’+…).

    Another interesting point is that, if you read all of the claims, none of them appear to apply to the 2D analogue of Simplex noise so long as it uses a gradient generator separate from the one described in claim #1. The skew function in Claim #2 only applies to 3D, and #5 explicitly refers to n>=3.

    And none of the patent claims speak about using surflets / “spherically symmetric kernels” to generate the “images with texture that do not have visible grid artifacts,” which is probably the biggest similarity between the two algorithms.

CREDITS

  • Kurt Spencer - Original work

  • A Svensson - Python port and package author

LICENSE

While the original work was released to the public domain by Kurt, this package is using the MIT license. Please see the file LICENSE for details.

Expected Output

2D noise (with default seed):

images/noise2d.png

3D noise:

images/noise3d.png

4D noise:

images/noise4d.png

Metadata

Release files for opensimplex 0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for opensimplex 0.1
File Size Uploaded Provenance Actions
opensimplex-0.1.tar.gz 12.8 kB Without provenance Details for opensimplex-0.1.tar.gz

Release files / opensimplex-0.1.tar.gz

Download URL opensimplex-0.1.tar.gz
Size 12.8 kB
Tags Source
SHA-256 checksum
How to use checksums
8db362782f8aaa574e32fec2fd38b69b961cac7d10431093e28d97289ff796bd
BLAKE2b-256 checksum
How to use checksums
72f5f32ae00a0644c51966e950348eb18641333741b42d6211331847bb6de9e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for opensimplex 0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page