← Back to list

The Art of an Expanding Universe in Black and White

Introduction

Rey Rad · 2025-01-02 19:24 · 0 claps · 2.0 min read
#art #algorithmic-design #universe #reyrad #code-art
Open on Medium ↗
Wiki topics: CUL · Culture & Media 💻 · Programming 🔭 · Astronomy & Space

The Art of an Expanding Universe in Black and White

Expanding Universe- Algorithmic Art by Rey Rad

Expanding Universe- Algorithmic Art by Rey Rad

Introduction

The concept of an expanding universe, portrayed through black-and-white algorithmic art, is a stunning way to blend science, mathematics, and creativity. This minimalist aesthetic emphasizes depth and motion, capturing the grandeur of the cosmos using simple yet elegant visuals. Such art is not only visually arresting but also an exciting field for computational exploration, where programming and algorithms bring abstract ideas to life.

Creating Algorithmic Art

Algorithmic art is typically generated using Python, Processing, or JavaScript programming languages. These tools allow for precise manipulation of shapes, patterns, and motion through mathematical equations and iterative processes. We will use radial symmetry, fractals, and particle dynamics to simulate outward motion for our expanding universe piece.

Basic Coding Framework for Generative Art

Below is an example using Python with the popular P5 library (a Python adaptation of the Processing framework). This example demonstrates how to create a visual inspired by an expanding universe.

from p5 import *

def setup():
    size(800, 800)  # Canvas size
    background(0)  # Black background
    no_loop()

def draw():
    translate(width / 2, height / 2)  # Set origin to center of canvas

    for i in range(200):  # Number of radial patterns
        angle = random(TWO_PI)  # Random angle in radians
        radius = random(50, 400)  # Distance from the center
        x = radius * cos(angle)  # X-coordinate
        y = radius * sin(angle)  # Y-coordinate

        stroke(255)  # White lines
        stroke_weight(random(1, 3))  # Random line thickness
        line(0, 0, x, y)  # Draw a line from the center to the edge

        # Adding spiral-like fractal detail
        for j in range(10):
            angle_offset = angle + j * random(0.05, 0.1)
            x_inner = radius * cos(angle_offset)
            y_inner = radius * sin(angle_offset)
            point(x_inner, y_inner)

def key_pressed():
    if key == 's':
        save_frame('expanding_universe.png')  # Save the artwork when 's' is pressed

run()

How It Works

  1. Canvas Setup: The setup function initializes the canvas and background.
  2. Radial Lines: The main structure consists of lines radiating outward from the center. Each line’s angle and length are randomized to create an organic look.
  3. Fractal Details: Additional points along the lines simulate smaller cosmic details like particles and stars.
  4. Interactivity: The key_pressed function allows the user to save the artwork with a simple key press.

Expanding Horizons

This basic framework can be expanded upon with:

  • Dynamic Animation: Use the draw loop to create an ever-expanding effect.
  • Advanced Patterns: Introduce mathematical fractals like the Mandelbrot set for intricate designs.
  • Color Gradients: Even within a monochrome palette, varying grayscale shades can add depth.

Conclusion

Creating algorithmic art, such as an Expanding Universe, bridges the gap between technology and aesthetics, providing a platform for limitless creativity. Whether you’re a programmer or an artist, delving into generative art offers a new perspective on the beauty of the cosmos and the power of algorithms.


메타데이터
post_id
9f188ffc7bd2
slug
the-art-of-an-expanding-universe-in-black-and-white-9f188ffc7bd2
url
https://medium.com/@rh.h.rad/the-art-of-an-expanding-universe-in-black-and-white-9f188ffc7bd2
canonical_url
https://medium.com/@rh.h.rad/the-art-of-an-expanding-universe-in-black-and-white-9f188ffc7bd2
author_url
https://medium.com/@rh.h.rad
status
ok
fetched_at
2026-06-09 15:37:30