DEV Community

Masato Ohba
Masato Ohba

Posted on

My first step in learning Generative Art

Even though I'm absolutely a newbie of generative art (I started it just today!), I found it quite fascinating. So I'm telling my passion here.

What's Generative Art?

Let's see the quotation from Wikipedia.

Generative art refers to art that in whole or in part has been created with the use of an autonomous system.

"Generative art" is often used to refer to algorithmic art (computer generated artwork that is algorithmically determined).
https://en.wikipedia.org/wiki/Generative_art

When I know generative art, I felt that it could be a chance to sophisticate my poor aesthetic sense with my programming skill.

If you'd like to try it right now, there's an interactive online editor. Visit https://alpha.editor.p5js.org/, then copy & paste my code into the editor on the page and see what will be happening.


Artworks

It's embarrassing to call them "artworks"... But let me introduce them to tell what I have experienced.

"Interfering objects"

This is my first generative art. Doesn't it smell mathematics?

image

Although there might be some unfamiliar functions, what creates the picture is familiar JavaScript code, which uses p5.js.

function setup() {
  createCanvas(400, 400);
  background(80)
  noStroke();
  frameRate(6);
}

function draw() {
  for (var i = 0; i < 400; i++) {
    var r = random(0,200);
    stroke(r * 1);
    line(0, i, r, r);
    line(400, i, 50 + r, 100+r);
  } 
}
Enter fullscreen mode Exit fullscreen mode

"Light path in the dark"

light

function setup() {
  createCanvas(720, 400);
  background(80)
  noStroke();
}

function draw() {
  fill(color(random(20),random(200),random(200), 1));   
  bezier(random(500, 550), random(500, 550), 0, 0, 40, 40, 50, 90);
  bezier(random(100, 200), random(100, 350), 0, 0, 40, 40, 50, 90);
}
Enter fullscreen mode Exit fullscreen mode

Okay, I know my artworks above are not amazing stuff. But I'll keep training and keep publishing so that I become a person who is good at generative art.

Besides, I'm happy if dev.to would get more artists with programming background!

Top comments (4)

Collapse
 
dmerand profile image
Donald Merand

Very cool!

Collapse
 
tadaboody profile image
Tomer

Inspiring!

Collapse
 
jess profile image
Jess Lee

This is awesome!

Collapse
 
lucasrafaldini profile image
Lucas Rafaldini

Reaaaaally inspiring. Thanks for sharing!