1 unstable release
| 0.2.0 | Jul 15, 2025 |
|---|
#1437 in Images
63 downloads per month
Used in 4 crates
(3 directly)
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 fieldsgabor: Gabor noise for procedural textures and patternswhite: White noise and pseudo-random number generationsinusoid: Sinusoidal noise patternsimg_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