Page:
patterns-animation-Perlin-Noise-Fractal
Pages
Home
nodes-scriptable-conditioning
nodes-scriptable-empty-latent
nodes-scriptable-image
nodes-scriptable-latent
nodes-scriptable-mask
nodes-scriptable-noise
patterns-Overview
patterns-animation-Mandelbrot-Zoom
patterns-animation-Overview
patterns-animation-Perlin-Noise-Fractal
patterns-animation-Plasma-Effect
patterns-animation-Recursive-Pattern
patterns-animation-Sine-Wave-Interference
patterns-earthbound-Color-Cycling-Gradient
patterns-earthbound-Earthbound-Warping-Distortion
patterns-earthbound-Fractal-Brownian-Motion
patterns-earthbound-HDMA-Scanline-Loop
patterns-earthbound-HDMA-Scanline-Shift
patterns-earthbound-Kaleidoscope-Loop
patterns-earthbound-Moire-Interference-Loop
patterns-earthbound-Moire-Interference
patterns-earthbound-Multi-Layer-Plasma
patterns-earthbound-Overview
patterns-earthbound-Radial-Breathing-Loop
patterns-earthbound-Rotating-Fractal-Loop
patterns-earthbound-Seamless-Plasma-Loop
patterns-mathematical-foundations
patterns-psychedelic-Fractal-Noise-Gradient
patterns-psychedelic-Overview
patterns-psychedelic-Plasma-Color-Cycling
patterns-psychedelic-Scanline-Shift
scriptable-conditioning
scriptable-empty-latent
scriptable-image
scriptable-latent
scriptable-mask
scriptable-noise
No results
2
patterns-animation-Perlin-Noise-Fractal
Balazs Horvath edited this page 2026-04-18 11:13:08 +02:00
Perlin Noise Fractal
Torch-based Perlin-like noise with varying Gaussian filter for smooth transitions.
Mathematical Formula
\text{noise} = \text{rand}(H, W, 3) \\
\sigma(t) = 5 + 10 \cdot \sin(t/10) \\
\text{smooth\_noise} = \text{gaussian\_filter}(\text{noise}, \sigma(t))
Where:
- Random noise smoothed by Gaussian filter
- Sigma varies with time for dynamic effect
How It Works
Perlin noise creates smooth, organic-looking patterns by smoothing random noise with a Gaussian filter. Varying the filter's sigma over time creates dynamic transitions between different detail levels.
Implementation
import torch
from scipy.ndimage import gaussian_filter
import numpy as np
# Generate Perlin-like noise animation
width, height = 512, 512
frames = []
for t in range(30):
# Base noise
noise = torch.rand(height, width, 3).numpy()
# Apply Gaussian filter with varying sigma for smooth transitions
sigma = 5 + 10 * np.sin(t / 10)
smooth_noise = gaussian_filter(noise, sigma=sigma)
# Convert to tensor
smooth_noise = torch.from_numpy(smooth_noise).float()
frames.append(smooth_noise)
output_image = torch.stack(frames, dim=0) # Shape: [30, H, W, 3]
Line-by-Line Explanation
noise = torch.rand(height, width, 3).numpy()
Generates random noise in [0, 1] range.
sigma = 5 + 10 * np.sin(t / 10)
Sigma oscillates between 5 and 15 over time.
smooth_noise = gaussian_filter(noise, sigma=sigma)
Smooths noise with varying blur amount.
Customization
Constant Sigma
sigma = 10 # Fixed blur
Larger Range
sigma = 2 + 20 * np.sin(t / 10) # 2 to 22
Different Frequency
sigma = 5 + 10 * np.sin(t / 5) # Faster variation
References
- See also: Fractal Brownian Motion