Skip to main content

A simple and fast Perlin noise generation library

Project description

Fast Perlin Noise

This is a very fast Perlin noise library, mostly in Go with Python bindings, that I developed upon trying out a few other available Python libraries and realized that none were fast enough for my project requirements. Algorithms are from the libnoise dotnet project which I ported to Go.

Installation

To install fast_perlin_noise,

pip3 install fast-perlin-noise

Wheels are automatically built for Windows, Linux, and macOS for x86-64 and ARM64 architectures. If a wheel does not exist for your platform, you will require a Go compiler to complete the installation.

Dependencies

fast_perlin_noise has very limited dependencies: only numpy is required!

Tests and Examples

fast_perlin_noise has a very beginner friendly Python interface, with optional advanced use.

from fast_perlin_noise import PerlinNoise
import numpy as np
import matplotlib.pyplot as plt

noise_generator: PerlinNoise = PerlinNoise(width=256, height=256)
noise_image: np.ndarray = noise_generator.generate_noise_matrix()

plt.imshow(noise_image)  # View the resulting noise

Perlin Noise

You can run and look at example/example.py to see this in action.

Output

fast_perlin_noise currently outputs a matrix (an ndarray with the shape m, n) of noise of which the values range from 0.0 to 1.0.

Interface and Parameters

For more advanced use, many parameters can be tuned to adjust the resulting noise. Perlin noise can be generated using the generate_noise_matrix function.

Parameter Type Description
width uint Width of resultant matrix.
height uint Height of resultant matrix.
persistence float Intensity falloff coefficient of subsequent noise layers.
numLayers uint Number of simplex noise layers to use.
roughness float Frequency increase coefficient for subsequent noise layers.
baseRoughness float Initial frequency for noise
strength float Scalar multiplier for noise values
randomSeed float Define the random seed to be used

Controlling Noise Output

Behaviour of the noise can be changed by changing parameters to the PerlinNoise interface. Settings include width and height to determine the dimensions of the resulting matrix. baseRoughness and roughness to control the frequency and frequency falloff. persistence to change the impact of subsequent layers (low value results in a "softer" look). numLayers controls how many layers of noise will be used (more layers results in more complex, structured noise). strength is a simple scalar multiplier to the matrix (control intensity of noise). Lastly, randomSeed can be changed to change the seed of the noise (fast_perlin_noise is deterministic when randomSeed is known).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fast_perlin_noise-1.1.2.tar.gz (96.3 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

fast_perlin_noise-1.1.2-cp313-cp313-win_amd64.whl (814.2 kB view details)

Uploaded CPython 3.13Windows x86-64

fast_perlin_noise-1.1.2-cp313-cp313-macosx_11_0_arm64.whl (788.9 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

fast_perlin_noise-1.1.2-cp312-cp312-win_amd64.whl (814.4 kB view details)

Uploaded CPython 3.12Windows x86-64

fast_perlin_noise-1.1.2-cp312-cp312-macosx_11_0_arm64.whl (788.9 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

fast_perlin_noise-1.1.2-cp311-cp311-win_amd64.whl (814.4 kB view details)

Uploaded CPython 3.11Windows x86-64

fast_perlin_noise-1.1.2-cp311-cp311-macosx_11_0_arm64.whl (788.9 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

fast_perlin_noise-1.1.2-cp310-cp310-win_amd64.whl (814.4 kB view details)

Uploaded CPython 3.10Windows x86-64

fast_perlin_noise-1.1.2-cp310-cp310-macosx_11_0_arm64.whl (788.9 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

fast_perlin_noise-1.1.2-cp39-cp39-win_amd64.whl (814.4 kB view details)

Uploaded CPython 3.9Windows x86-64

fast_perlin_noise-1.1.2-cp39-cp39-macosx_11_0_arm64.whl (788.9 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

File details

Details for the file fast_perlin_noise-1.1.2.tar.gz.

File metadata

  • Download URL: fast_perlin_noise-1.1.2.tar.gz
  • Upload date:
  • Size: 96.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for fast_perlin_noise-1.1.2.tar.gz
Algorithm Hash digest
SHA256 d94a2e6f13b9841e328b1aebc2dbee28ebc71289562a31ea002fe058aac1ac95
MD5 1b489001456da0e6eea23250c0f9cc50
BLAKE2b-256 037fd1a1e2cf97f34d2ae03ca0396460522f93df487640a8b6a1b91140e2da96

See more details on using hashes here.

File details

Details for the file fast_perlin_noise-1.1.2-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for fast_perlin_noise-1.1.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 59c0b798aa08cb2d6ee014347292517ca27b59289257ef5d35952f95246298cb
MD5 5bb763e3f670906221e0c75504111844
BLAKE2b-256 bfa9b45babe50c9938343f115410e51b54a0ded7ab3a45a0fae46c796644cd5d

See more details on using hashes here.

File details

Details for the file fast_perlin_noise-1.1.2-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for fast_perlin_noise-1.1.2-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ae3b0ea5ba1161baaed179bb2b679b0318d4a95e336be632390ba6cd281c244d
MD5 54b165cec94941e15b39b466f02048e0
BLAKE2b-256 cf240649b4a17c9fdb0705cab4a95516b240e95bcbf71b1776e3bdda19916cf0

See more details on using hashes here.

File details

Details for the file fast_perlin_noise-1.1.2-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for fast_perlin_noise-1.1.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 204f5679e67213f38aa164584dc00e2c8c050c52d3d27cf698fcdd174093dc2c
MD5 14d0eec6533eb59e387ddc832d500e33
BLAKE2b-256 efa5dc9e35c16d31acd105f57d7ca888aeb9407d8a0c690a2087998af7b079e2

See more details on using hashes here.

File details

Details for the file fast_perlin_noise-1.1.2-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for fast_perlin_noise-1.1.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 530897c34efbd25c2d93a582d71f1e8c6f9c7882b730151e1cc6b1d88a9c142d
MD5 1b3a61e54a7783b3acd90d3a30116954
BLAKE2b-256 8e6f4a1b82e8ba36c09864b0d3ad7781938bb4f4622663a2aca26d3ff876bc7f

See more details on using hashes here.

File details

Details for the file fast_perlin_noise-1.1.2-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for fast_perlin_noise-1.1.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 caee7117d837adbb5ba32214f4c10493f374facac02ce278cc7a30b807ef6466
MD5 cf7d8740b88939948b185e2946beb01d
BLAKE2b-256 759caad6f87e810940d1c3b99ecfda1b082f105206575587824cfe135a7ec54d

See more details on using hashes here.

File details

Details for the file fast_perlin_noise-1.1.2-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for fast_perlin_noise-1.1.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 777f7d5f6e5a4928a097705af67f4af2e17cd9203b8e62376e95ec36c3e3c513
MD5 5176c4c44114daa985c1575ff7aa7ab3
BLAKE2b-256 61b3b9f04b62b38ec1f28b31c49df37d9f0f370edee42d07291eef0880cca9c4

See more details on using hashes here.

File details

Details for the file fast_perlin_noise-1.1.2-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for fast_perlin_noise-1.1.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 6a61f943b4d0de18bc0b81ca91f476aec10127ab8de53b2a32978345954cabba
MD5 90eaaf0f52e9cd7ec283a737982318e5
BLAKE2b-256 fba5b4b50bd3f9eca00ee28dcb11a54af8f330db3368db7ce7393c70159f53af

See more details on using hashes here.

File details

Details for the file fast_perlin_noise-1.1.2-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for fast_perlin_noise-1.1.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4d6400af3e59e05d2d119be7e28587b579dbfbc9408bbae3e056506f251782db
MD5 09325bc1827e5efcf5a904a196791ccc
BLAKE2b-256 0350579fa2f73809b75190d9fb99d33389ddb700d2b7e89daa81817263210855

See more details on using hashes here.

File details

Details for the file fast_perlin_noise-1.1.2-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for fast_perlin_noise-1.1.2-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 41eb451ce576bee7ec2c81ae9a9f6c353c7f56dd66fe0a909e8e698f4d7f26e0
MD5 62402c0fcf2efbad412003bfe2d1a9d8
BLAKE2b-256 97c3958bea6f5e5546880f87f20945a64741c245994e6d2fb4de977293a0bf40

See more details on using hashes here.

File details

Details for the file fast_perlin_noise-1.1.2-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for fast_perlin_noise-1.1.2-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 839a4c6a85ad6fef925cdc1e2ac41a6150a199d1108aaaa36ef48f35e6fa4e77
MD5 d7db2b21102548e0b27b0aa265454fdf
BLAKE2b-256 e8b62b90e7386c399c604ad842e3d95ebece02432f3625b1a376fe85bd562019

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page