Package: nPerlinNoise
nPerlinNoiseindexed on PyPI -nPerlinNoiserepo on GitHub -nPerlinNoisedocs on ReadTheDocs -A robust open source implementation of Perlin Noise Algorithm for N-Dimensions in Python.ApowerfulandfastAPI forn-dimensionalnoise.Easy hyper-parameters selection ofoctaves,lacunarityandpersistenceas well as complex and customizable hyper-parameters for n-dimensionfrequency,waveLength,warp(interpolation) andrange.Includes various helpful tools for noise generation and for procedural generation tasks
such as customizableGradient,Color Gradients,Warpclasses.Implements customPRNGgenerator for n-dimension and can be easily tuned.Details:Technology stack:Status:v0.1.4-alphafocusing on all issuesGetting Involved, follows PEP440All Packages:releasesCHANGELOGTested on Python 3.10, Windows 10Future work:optimizationfor octave noisewritingunit testswritingAPI docswritingpending docswritingReadTheDocsbloggingfinishing leftin-code docsdimensionaloctavesScreenshots:DependenciesPython>=3.10.0for production dependencies seeRequirementsfor development dependencies seeDev-RequirementsInstallation$pipinstallnPerlinNoisefor detailed instruction on installation seeINSTALLATION.UsageSetup>>>importnPerlinNoiseasnPN>>>noise=nPN.Noise(seed=69420)Basic usageGet noise values at given n-dimensional coordinates by callingnoise(...),coordinates can be single value, or an iterablesingle valuenoise(..., l, m, n, ...)where l, m, n, ..., are single values>>>noise(73)array(0.5207113, dtype=float32)>>>noise(73,11,7)array(0.5700986, dtype=float32)>>>noise(0,73,7,11,0,3)array(0.5222712, dtype=float32)iterablenoise(...., [l1, l2, ..., lx], [m1, m2, ..., mx], [n1, n2, ..., nx], ....)where ...., are iterable of homogeneous-dimensions and lx, mx, nx, ..., are single values
the output will be of same shape of input homogeneous-dimensions>>>noise([73,49])array([0.52071124, 0.6402224 ], dtype=float32)>>>noise([73,49],[2,2])array([0.4563121 , 0.63378346], dtype=float32)>>>noise([[73],[49],[0]],...[[2],[2],[2]],...[[0],[1],[2]])array([[0.4563121 ],[0.6571784 ],[0.16369209]], dtype=float32)>>>noise([[1,2],[2,3]],...[[1,1],[1,1]],...[[2,2],[2,2]])array([[0.08666219, 0.09778494],[0.09778494, 0.14886124]], dtype=float32)noise(..., l, m, n, ...)has same values with trailing dimensions having zero as coordinaten-dimensionalitynoise(..., l, m, n) = noise(..., l, m, n, 0) = noise(..., l, m, n, 0, 0) = noise(..., l, m, n, 0, 0, ...)>>>noise(73)array(0.5207113, dtype=float32)>>>noise(73,0)array(0.5207113, dtype=float32)>>>noise(73,0,0)array(0.5207113, dtype=float32)>>>noise(73,0,0,0,0)array(0.5207113, dtype=float32)grid mode allows for computing noise for every combination of coordsusenoise(..., gridMode=True)gridMode is key-word only argument, default=Falsethe output will be of shape equal to the length(s) of coords in that ordergridMode>>>noise([73,49],[2,2],[0,1],gridMode=True)array([[[0.4563121 , 0.63378346],[0.4563121 , 0.63378346]],[[0.44594935, 0.6571784 ],[0.44594935, 0.6571784 ]]], dtype=float32)>>>noise([1,20,32,64],[1,1,2],0,[1,2],gridMode=True)array([[[[0.06459193, 0.5110498 , 0.669962  , 0.47636804],[0.06459193, 0.5110498 , 0.669962  , 0.47636804],[0.09864856, 0.5013973 , 0.62935597, 0.47954425]]],[[[0.07678645, 0.50853723, 0.6778991 , 0.4679888 ],[0.07678645, 0.50853723, 0.6778991 , 0.4679888 ],[0.14069612, 0.47582665, 0.6663638 , 0.48764956]]]],dtype=float32)for detailed usage seeEXAMPLEAPIdocs pendingHow to test the softwareTo test Logical consistency runtestLogicTo test Profile Benchmarking runtestProfileTo test Visuals runtestVisualsTo test Colors runtestColto see all tests seeTestsKnown issuesNo Known BugsNPerlin.findBounds is bottlenecknoise(a, b, c, d, e, f, ...) is slow for single value coordinatesGetting helpCheckmain.pyfor detailed usageCheckdocsfor all documentationsCheckUsageSectionIf you have questions, concerns, bug reports, etc.
please file anissuein this repository's Issue Tracker or
open adiscussionin this repository's Discussion section.Getting involvedLooking for Contributors for feature additionsLooking for Contributors for optimization#11Looking for Contributors for unit testing#12Looking for Contributors for ReadTheDocs#13Looking for Contributors for WebApp#14Looking for Contributors for API docs#15Forkthe repository
and issue aPRto contributeGeneral instructions onhowto contributeCONTRIBUTINGandCODE OF CONDUCTOpen source licensing infoTERMSLICENSECFPB Source Code PolicyCredits and referencesInspired fromThe Coding Train->perlin noisehash function byxxhashinspired therand3algo
and ultimately helped for O(1) time complexity n-dimensional random generatorNPrngStackOverflowfor helping on various occasions throughout the developmentvnoiseandopensimplexfor ideas for README.mddocs derivative fromopen-source-project-templatepackaging help fromrealpythonMaintainer:Amith M