Page:
patterns-psychedelic-Fractal-Noise-Gradient
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-psychedelic-Fractal-Noise-Gradient
Balazs Horvath edited this page 2026-04-18 11:13:10 +02:00
Fractal Noise Gradient
Multi-scale noise with psychedelic color mapping and subtle rotation effect.
Mathematical Formula
\text{noise} = \sum_{i=0}^{N} 2^{-i} \cdot n(2^i \cdot x)
\text{gradient} = \frac{\text{noise} - \min}{\max - \min}
R = \text{gradient}
G = \text{gradient} + \frac{2\pi}{3}
B = \text{gradient} + \frac{4\pi}{3}
Where:
iis octave indexn()is noise function- Normalization maps to
[0, 1].
How It Works
Fractal noise creates organic-looking textures by summing noise at multiple scales. Each octave has higher frequency but lower amplitude, creating detail at multiple scales. Cross-channel color mixing creates a psychedelic palette.
Implementation
import torch
from scipy.ndimage import gaussian_filter
import numpy as np
width, height = 512, 512
frames = []
for t in range(30):
# Generate noise at multiple scales
noise_layers = []
for scale in [4, 8, 16, 32]:
noise = torch.rand(height//scale, width//scale).numpy()
noise = gaussian_filter(noise, sigma=2)
noise = torch.tensor(noise).unsqueeze(-1).repeat(1, 1, 3)
noise = torch.nn.functional.interpolate(
noise.unsqueeze(0),
size=(height, width),
mode='bilinear'
).squeeze(0)
noise_layers.append(noise)
# Combine layers
fractal = sum(noise_layers) / len(noise_layers)
# Map to psychedelic palette (purple, pink, cyan)
r = fractal[:, :, 0] * 0.6 + fractal[:, :, 1] * 0.4
g = fractal[:, :, 1] * 0.5 + fractal[:, :, 2] * 0.5
b = fractal[:, :, 2] * 0.7 + fractal[:, :, 0] * 0.3
rgb = torch.stack([r, g, b], dim=-1).clamp(0, 1)
# Add subtle rotation effect
angle = t * 0.05
rgb = torch.rot90(rgb, k=int(angle / (torch.pi/2)))
frames.append(rgb)
output_image = torch.stack(frames, dim=0)
Line-by-Line Explanation
for scale in [4, 8, 16, 32]:
Iterates through octaves (powers of 2).
noise = gaussian_filter(noise, sigma=2)
Smooths noise to create spatially coherent patterns.
r = fractal[:, :, 0] * 0.6 + fractal[:, :, 1] * 0.4
Cross-channel mixing: red gets 60% from itself + 40% from green.
rgb = torch.rot90(rgb, k=int(angle / (torch.pi/2)))
Rotates by 90° increments based on time.
Customization
More Octaves
for scale in [2, 4, 8, 16, 32, 64]:
Different Sigma
noise = gaussian_filter(noise, sigma=5) # Smoother
No Rotation
# Remove rotation line
References
- See also: Fractal Brownian Motion for Earthbound version