Skip to main content

A numpy-based noise generator

Project description

Table of Contents

  1. Vectorized value & gradient noise with NumPy
    1. Install with PIP
    2. Install locally
    3. Examples

Vectorized value & gradient noise with NumPy

Rumore is a lightweight Python library for procedural noise. It provides value noise and gradient noise in 1D/2D/3D plus octave summation of these (fractal Brownian motion, fBm).

The library does not implement Ken Perlin’s original algorithm directly, but its gradient noise produces visually similar results.

Install with PIP

pip install rumore

Install locally

Clone the repo, navigate to the directory and from there

pip install -e .

Examples

Import necessary stuff

from importlib import reload
import matplotlib.pyplot as plt
import numpy as np
import rumore

Generate some 1d gradient noise with different number of octaves

reload(rumore)
x = np.linspace(-10, 10, 200)
plt.figure(figsize=(5,4))
for i in range(1, 8):
    plt.plot(x, rumore.grad_noise(x, octaves=i))
plt.show()

img

Perturb points along a circle with 2d noise

t = np.linspace(0, np.pi*2, 200)
x = np.cos(t)
y = np.sin(t)
r = rumore.grad_noise(x, y)*0.5+0.5
plt.figure(figsize=(4,4))
plt.plot(x*r, y*r)
plt.show()

img

Generate a grid of 2d noise value (a grayscale image)

reload(rumore)
x = np.linspace(0, 5, 300)
y = np.linspace(0, 3, 100)
img = rumore.noise_grid(x, y)
plt.imshow(img)
plt.show()

img

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

rumore-0.1.3.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

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

rumore-0.1.3-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file rumore-0.1.3.tar.gz.

File metadata

  • Download URL: rumore-0.1.3.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.8

File hashes

Hashes for rumore-0.1.3.tar.gz
Algorithm Hash digest
SHA256 270ef910d1d295fafddea4e04948bb77e62be11fc4e610456ba2f62ea298ef26
MD5 eab4add7ec7f09d900e7ff7b46add1c3
BLAKE2b-256 71a238ea21e7ee8387d7817b814b5c39f4942b954c72663a6657b0630165439b

See more details on using hashes here.

File details

Details for the file rumore-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: rumore-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.8

File hashes

Hashes for rumore-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 73cbdf15f8d083674e4f0f158ef01692c6c0d7b6e8181699cc30917a604091d1
MD5 519216dfd298dfb3c5d44e1d7c5f8b8b
BLAKE2b-256 474fd5901e6360c7c1452ba7f00377b715cebbf00c8103842df7c912969c43aa

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