p5.js generative image

Abstract Landscape

A slow generative drawing created with repeated transparent ellipses. The saved image was captured after letting the sketch build over time.

Back
Black Sunflower generative artwork
Black Sunflower
Live process
View full p5.js code
let a = 0;
let r = 0;

function setup() {
  createCanvas(600, 400);
  background(0);
}

function draw() {

  push();

  translate(width/2, height/2);

  let x = cos(a) * r;
  let y = sin(a) * r;

  noFill();

  stroke(255, 10);
  strokeWeight(1);

  ellipse(
    x,
    y,
    random(10, 50),
    random(10, 50)
  );

  pop();

  a += 0.3;
  r += 0.2;

  // Kad sasniedz malas, sāk no jauna
  if (r > 300) {
    r = 0;
  }
}

function mousePressed() {
  saveCanvas("Saulespuke", "jpg");
}