Ridges: Creating Layered Landscapes with Stacked Lines
Technique Overview: Ridges create stunning abstract landscapes by stacking horizontal lines that are each bent by noise. Each line represents a layer of terrain, with higher rows appearing in front and hiding the ones behind them - creating a sense of 3D depth from simple 2D lines.
How It Works
The algorithm creates an array of horizontal lines where each line's shape is determined by:
- Noise function: A Perlin noise (or similar) that gives each x-position a height value
- Envelope: Makes the bumps tallest in the middle and flat at the edges, creating natural-looking terrain
- Color gradient: Colors rows based on their y-position, creating smooth transitions from top to bottom
- Background fill: Each row is filled with its color before drawing, so nearer ridges hide distant ones (painter's algorithm)
The Code Structure
Using Python with numpy and PIL, the script creates lines like this:
# Simplified concept:
for y in range(height):
color = interpolate_color(y) # Gradient from top to bottom
for x in range(width):
height_at_x = noise(x, y) * envelope(y)
line_points.append((x, height_at_x))
fill_row(color) # Painter's algorithm - draw behind first
draw_line(line_points)
Parameters You Can Play With
--palette dusk|ocean|paper|forest- Choose a color scheme--rows N- Number of horizontal layers (more rows = more detail)--height H- Vertical resolution of the noise (affects how "chunky" each ridge looks)--scale S- How much the noise affects the line height (larger = more dramatic peaks and valleys)
Example Commands
Create a dusk palette landscape:
python3 ~/tools/art/ridges.py NAME --seed 42 --palette dusk --rows 80 --height 300 --scale 0.005
Create an ocean sunset scene:
python3 ~/tools/art/ridges.py NAME --seed 123 --palette ocean --rows 85 --height 280 --scale 0.0045
Visual Characteristics
Ridges pieces typically show:
- Layered depth: Each line appears in front of the previous one, creating a sense of elevation
- Smooth color gradients: Colors shift smoothly from top to bottom based on palette choice
- Natural-looking forms: The envelope function ensures peaks are tallest in the middle, like real terrain
- Organic complexity: Simple noise + simple stacking = surprisingly complex, natural-looking landscapes
Why This Technique is Beautiful
Ridges demonstrates the magic of generative art: by combining just three concepts (horizontal lines, noise heights, and painter's algorithm), you get visuals that feel like real landscapes - mountains, valleys, and atmospheric perspective all emerging from simple mathematical rules.
The technique is particularly effective because it creates "readable" forms - the brain can perceive depth, light, and even implied elevation from just lines. It's like topographic maps made visual and artistic.
Related Techniques
- Reaction-diffusion: Creates self-organizing cellular patterns with similar organic quality
- Flow fields: Tracing paths through invisible currents, also creating natural-looking movement
Conclusion
Ridges is a deceptively simple technique that produces stunning abstract landscapes. The beauty comes from understanding that complex natural forms can emerge from very basic rules - horizontal lines with noise heights, painted in layers. It's a reminder that generative art isn't about creating randomness, but about finding the right mathematical frameworks for natural-looking complexity.
Key takeaway: Sometimes the most beautiful visuals come from combining simple ideas (lines + noise + layering) rather than complex algorithms. The ridges technique produces mountain-range-like forms that feel organic and natural, demonstrating how generative art can capture the essence of nature through mathematics.