1 unstable release

0.2.0 Jul 15, 2025

#1437 in Images

Download history 50/week @ 2025-07-09 117/week @ 2025-07-16 34/week @ 2025-07-23 50/week @ 2025-08-06 9/week @ 2025-08-13 68/week @ 2025-08-20 10/week @ 2025-08-27 31/week @ 2025-09-03 39/week @ 2025-09-10 12/week @ 2025-09-17 23/week @ 2025-09-24 17/week @ 2025-10-01 30/week @ 2025-10-15 15/week @ 2025-10-22

63 downloads per month
Used in 4 crates (3 directly)

MIT/Apache

35KB
786 lines

Wassily Noise

Noise generation utilities optimized for generative art applications. This crate provides ergonomic wrappers around the Rust noise library with f32 support, additional noise functions, and utilities specifically designed for creative coding and generative art.

Key Features

  • f32 Support: All noise functions work with f32 instead of f64 for better performance
  • Scale-Independent: Noise scaling that adapts to canvas size automatically
  • Generative Art Focus: Additional noise types specifically useful for creative coding
  • Easy Integration: Seamless integration with wassily's canvas and shape systems

Available Noise Types

  • Core Functions: [noise2d()], [noise3d()] with normalized variants
  • curl: Curl noise for fluid-like effects and vector fields
  • gabor: Gabor noise for procedural textures and patterns
  • white: White noise and pseudo-random number generation
  • sinusoid: Sinusoidal noise patterns
  • img_noise: Image-based noise generation

Quick Start

use wassily_noise::*;
use noise::{NoiseFn, Perlin};

// Create a noise function
let perlin = Perlin::new(42);
let opts = NoiseOpts::default().scales(0.01);

// Generate noise values
let value = noise2d(perlin, &opts, 100.0, 150.0);      // Range: [-1, 1]
let normalized = noise2d_01(perlin, &opts, 100.0, 150.0); // Range: [0, 1]

Noise Options

The NoiseOpts struct provides fine-grained control over noise generation:

use wassily_noise::*;

let opts = NoiseOpts::default()
    .width(800.0)
    .height(600.0)
    .scales(0.005)        // Uniform scaling
    .factor(2.0);         // Amplitude multiplier

Dependencies

~12MB
~237K SLoC