Week 2 – Generative Art

My concept:

Initially I had lots of images saved from different types of designs, forms, and artists until I realized that I kept going back to page 19 in ProgrammInformation21_PI21. When it comes to art, I have drawn many zentangle-style pieces, which rely heavily on repetition and pattern, which is why I felt drawn to this specific art piece. I then decided to take inspiration from the piece and try to create movement similar to what I see. When I first looked at the image the shapes I saw were: triangles, squares, and circles. When I first looked at the image, the shapes I noticed were triangles, squares, and circles. Although circles are not clearly visible when zooming in, I decided to include them in my final piece to represent my initial visual interpretation of the artwork, hence why I called the piece Captured.

Inspiration from old computer art magazines: My project is inspired by early computer-generated art found in old programming and computer art magazines, where artists worked with limited tools leading to their reliance on shapes, repetition, and randomness.

Embedded Sketch:

How this was made:

This project took me around 4 hours to create. Much of the time was spent on searching and finding idea because I was just introduced to generative art and was still learning how randomness and loops affect visual outcomes. After finding the “perfect” inspiration I was then able to start brainstorming how I wanted my piece to look like.

At first I started off by creating just squares and triangles that were evenly spaced out but the results felt too structured compared to the chaotic image from the magazine. I then began experimenting with the [random] function:

let x = random (width); 
let y = random (height);

I combined this with rect() for squares and ellipse() for circles. Initially, I used a single square size [rect(x,y,10,10);] but unfortunately again, did not create the layered visual effect I wanted. To address this issue, I added more than one rect and played around with the width and height until I was able to layer three squares on top of each other with the small ellipse size. After I created the three different points for the triangles:

if (random(1) <0.8) { //80% chance to draw 3 rects and 1 ellips 
    rect(x,y,10,10); //x,y being random and 10,10 the W,H \|/ the same
    rect(x,y,7,7);
    rect(x,y,6,6);
    ellipse(x,y,5,5);
  } else { //the rest -> 20% will be triangles
    triangle(x, y-5, x-5, y+2, x+2, y+2);

I was also able to play around with the amount of shapes appearing on each frame (5) [for (let m = 0; m < 400; m++)]. Like everything else, starting is the hardest part so once I get used to the numbers and codes I used the rest of my time experimenting until I was satisfied with the results.

One code I am proud of:

for (let m = 0; m < 400; m++) { //drawing 400 shapes for every frame -> x5. Using m for my name

This was my favorite part of the code. I kept changing the number between 100 and 600 and experimenting with how the shapes changed and how the final piece turned out. In the end, I decided to keep it at 400 because it felt the closest to how I first saw the image. When I looked at everyone else’s self-portrait, I noticed that some people used this function, and at first I honestly didn’t understand how it worked. After looking into this source (JavaScript Loops Explained), I was finally able to create a similar effect and actually understand what the code can be used for instead of just copying it.

Resources: I of course wasn’t able to open p5.Js and create this project, so I kept referring back to the Week 2 lecture notes from both Professor Mang and Professor Aya’s weekly slides along with the website JavaScript Loops Explained Helped me create my code for the 400 shapes for each frame, I was able to make the loop but instead of using ‘i’ I just decided to use m for my name, adding a personal twist.

Full code:

function setup() {
  createCanvas(400, 400);
  frameRate(5); //to control the speed, or like I call this "the sets" I put 5 to make it slow but fast.
  noFill(); //black outline for the shapes
  stroke(0);
}

function draw() {
  background(255); //making the background white to match inspo

  for (let m = 0; m < 400; m++) { //drawing 400 shapes for every frame -> x5. Using m for my name
    
    //local variables created, so inside the loop each shape gets a new random position
    let x = random (width); 
    let y = random (height);
 
    if (random(1) <0.8) { //80% chance to draw 3 rects and 1 ellips 
      rect(x,y,10,10); //x,y being random and 10,10 the W,H \|/ the same
      rect(x,y,7,7);
      rect(x,y,6,6);
      ellipse(x,y,5,5);
    } else { //the rest -> 20% will be triangles
      triangle(x, y-5, x-5, y+2, x+2, y+2); //creating 3 different points for the triangle. Point 1: x, y-5 moving up. Point 2: x-5 moving left, y+2 moving down. Point 3: x+2 right, y+2 down
    }
  }
}

 

Reflection:

For future assignments, I think I’ll try to come up with ideas faster so I don’t spend so much time looking for the “perfect” inspiration before starting. Instead, I want to just start coding and see where it takes me. This feels like a fun challenge because the code can change so much depending on small adjustments. At the same time, having a general idea and then adjusting it as I go also works. I also want to experiment with more types of code. I know it’s not realistic to use every single thing we learn in one project, but it would be interesting to try combining more of them and seeing what comes out of it.

Week 2 – Zere – Creative Reading Response

  Casey Reas’s talk made me look at the concept of randomness differently. In my prior opinion, randomness was something that took away the “magic” of art, as it took away the artist’s control over what their piece will look like. Yet, Reas’s speech gave a new perspective of randomness, as in, that it can be used with intentionality, utilizing logical rules given and created by the artist, therefore giving them a sense of control over their work. Generative art is exactly that in my opinion. I think that the “magic” of art in this case is the artist designing the structure, giving the rules, setting the limits on variations etc. Artists in this case, I think, showcase that code can be used as an art medium much like chalk, acrylic paint, colored pencils and various other types of mediums. If looked from the perspective that computers and generative tools were created by humans for humans, the same as paint and canvas, generative art is art. An artist can control the limits of the “random” decision made by the computer, and it can be exciting. Art is meant to be exciting, at least in my perspective of it. I am not saying it is meant to reach a deep part of your soul every time, but one of the reasons many people create art is for that sense of excitement it brings you. 

       Generative art is unique because of its randomness. One of the things that kept appearing in my head is chance operations in dance. I have taken Intro to Modern Dance last semester, and our professor introduced us to Merce Cunnigham’s work. His idea was to have a set of moves, number each of them, then randomly select the numbers and therefore build a unique dance each time. I feel like this is one of the examples of how I would like to utilize random elements in my work – having a set of elements that I adhere particular meaning to, then randomizing their order to see how many new and unique combinations I can get. In my opinion this is also an example of balancing randomness and control – you give an algorithm/ a machine a set of elements/variables that matter to you as an artist, but leave the combinational part up to the machine.

Week 2 – Creative Reading Response

Initally, I expected Casey Reas’ video to be more of a lecture-like talk about randomness and control, however, it was nice to see that his video consisted of a lot of examples as I prefer actually getting to watch, rather than just hearing about the ideas.  My favorite part of the examples was when he showed himself coding this maze-like images at the end. This is kind of where I started to find an answer to the balance between total randomness and complete control. He is in control of the shapes being drawn, but it’s up to the computer which shape is being drawn and when. However, it still created beautiful, unique pieces everytime. I’m excited to incorporate randomness into my work by kind of allowing the computer to ‘make the decisions’ for me when it’s minor things like where each box goes or what color each box is, but controlling the limits of these decisions. I also think another way of intrepreting randomness and control can be about controlling your own narratives for your work rather than following what the current trends are or what the preferred styles are. You insert randomness by being unexpected and doing what you prefer rather than what people might expect, and you gain control because you control the narrative.

While watching the video, I was just doodling on my iPad, and I feel like it’s a nice example of randomness (with a bit of control). 

Week 2 – Generative Artwork

Your concept

I was scrolling through the provided old computer art magazines for inspiration, and  I ended up liking the work Random Squares by Bill Kolomyjec from COMPUTER_GRAPHICS_AND_ART_Aug1977. I wanted to add my own touch to it, so I had two main goals, adding color and adding some kind of interaction with the cursor.

A highlight of some code that you’re particularly proud of
// this function makes a box dissapear when the cursor hovers over it.
function squareDissapear(xPos, yPos, size, offset) {
  
  let cellX = xPos - offset;
  let cellY = yPos - offset;
  
  // only active when mouse is within the canvas
  let mouseInside = (mouseX >= 0 && mouseX < width && mouseY >= 0 && mouseY < height)
  
  // true / false
  let hover = mouseInside && mouseX > cellX && mouseX < cellX + squareSize && mouseY > cellY && mouseY < cellY + squareSize;
  
  if (!hover) {
    square (xPos, yPos, size);
    return;
  }
  
  push();
  
  fill (220);
  noStroke();
  square(xPos, yPos, size)
  
  pop(); 
}

This is the interaction I ended up adding. When the cursor moves over a box, the box dissapears! I initally wanted to do some type of rotation but I wasn’t able to really understand how to use the functions correctly so as a comprimise, I landed on just doing dissapearing boxes as it was a bit simpler. Due to the way I did the loops to draw the boxes, it was still not very straightforward, so I did have to do some mental gymnastics to get it to work. However, I’m happy I was able to add this interaction, and it looks especially cool if you move the cursor over the preview screen quickly.

I did also add another interaction with the color changing. When the user clicks the mouse, the colors of all the boxes change!

Embedded Sketch

Click your cursor to change the color!

Reflection and ideas for future work or improvements

I enjoyed getting more creative for this work and taking inspiration from the works in the magazines provided. I would love to continue exploring generative art in my work and try to add more elements of interactivity. I definitely want to work on understanding the rotations and angles on p5.js so I can add that to my code.

Week 2 Generative Art Post Zere

    • My concept of this week’s generative art task is an apartment building in a big city. Using the “random” function, I made the windows show different colors each time the mouse is clicked, reflecting that each resident has different stories happening to them every day.
    • I came about this idea when experimenting with functions and watching YouTube tutorials for gen. art.  . YouTuber Patt Vira created a tutorial on random smiley faces generative art, and the changing colors reminded me of lights reflected in people’s windows at night. I chose Starry Night by Vincent Van Gogh as the background. I saw the original painting at MoMA in NYC, and I was reminded of New York when creating this piece of work, which is why I chose this painting as the background.
    • Piece of code that I am proud of: the changing of the window’s colors. There’s a dynamic change in art, as well as loops used, that prevented me from creating each rectangle manually.
    • Embedded sketch:

  • let bg;
    
    function preload() {
      bg = loadImage("starrynight.jpg");
    }
    
    function setup() {
      createCanvas(400, 400);
      noLoop();
    }
    
    function draw() {
      // Starry Night background
      image(bg, 0, 0, width, height);
    
      // Building
      fill(51, 0, 0);
      noStroke();
      rect(10, 20, 300, 390);
    
      // Door
      fill(255);
      rect(135, 300, 60, 90);
      //Doorknob
     stroke(0);
      strokeWeight(2);
      circle(190,345,10)
      // Windows
      stroke(0);
      strokeWeight(2);
    
      for (let y = 40; y < 260; y += 60) {
        for (let x = 40; x < 280; x += 60) {
          fill(random(200), random(200), random(200));
          rect(x, y, 40, 40);
        }
      }
    }
    
    function mousePressed() {
      redraw();
    }
    
    

     

  • Reflection and ideas for future work or improvements: I’m proud of this sketch because it creates a colorful grid of windows that changes every time you click, making it interactive and fun. In the future, I’d like to make the colors change gradually or add more shapes to make it even more dynamic.

Week 2 – Reading Response | Casey Reas @ Eyeo2012

There is often a debate about how the universe works. Are we really in control of what decisions we make, or has some otherworldly being already written them for us? Is destiny real? Are the things we deem unpredictable actually predictable, and when people say they’re unpredictable… are they really? 

These same questions can be made about artwork. Older (“traditional”)  artwork was very methodical; we could fit artwork into different “eras,” find commonalities within artworks in certain eras, understand a very specific technique that artists would follow during a certain period of time or in a certain geographical area. However, now with our unlimited access to the internet and the rise of globalization, art has branched out significantly. We have shifted from order to chaos – we have people raising questions about which artwork is better (the usual digital versus traditional artwork battle), who decides what art is, and whether that shovel in the corner can actually even be considered artwork! (For this one, we’ll have to ask Duchamp himself.)

I found this talk interesting and I found that many arguments linked to my conversations in other classes. In Understanding Interactive Media, we discussed procedural art; art that is more focused on the process, and not the end product itself. One example I want to discuss in relation to this video is Sol Lewitt’s “Wall Painting”. In this artwork, the same set of instructions are given to everyone – draw 50 points anywhere on a continuous stretch of wall, and then draw lines connecting these dots. Yet, every artwork that comes from these instructions come out differently – super random! The reason I bring this up is because I feel that in this video, we discuss whether there is true randomness in artwork. Randomness allows you to remove your own egos and “preconceived notions” from creative processes (or at least, that’s what artists like John Cage and Marcel Duchamp believe). Randomness is a jumping-off point to get outside your own ideas of correctness.

The thing with algorithms, however, is that even when you code something to be random, there may eventually be a point that the code reaches where it stops being random, especially in generative art. Depending on the complexity of the code, it may become the same earlier, or may take a very long time, but Reas discovered that it eventually will reach homogeneity. Humans cannot replicate the same drawing the exact same ever, but computers can eventually. Hence, how random really is randomness? You can add some randomness to keep a system homeostatic, to keep it consistent but also remain dynamic, but even then, this is still a confusing concept to me. Even with the example of Mondrian explaining that the grid can still be used to represent pure feeling, through his physical brushstrokes being visible, that made me wonder about the difference in human and computer artwork.

In regards to making my own generative artwork, I made it before watching the video completely. Even when making it, I knew that no two artworks would be the same at the beginning, but eventually, at some point (whether it be in a thousand runs or even millions), there will be a moment where my artwork will be the same as another iteration earlier. Thus, maybe we can also acknowledge randomness depending on scale and complexity. Maybe the art we code doesn’t have to be 100% random, because maybe we will never be able to reach that certain percentage. However, within the percentages we can reach, we can play around with them and have fun.

Week 2 – Generative Artwork – Kamila Dautkhan

Concept:

let a = 0;
let b = 0;
let c = -1;
var z = 0;
var cef = 45;

function setup() {
  createCanvas(1000, 1000);
  background(200);
}

function draw() {
  
  translate(width/2, height/2);
  rotate(b);
  
  for(let i=0; i < 500; i++){
    
    let x = b*sin(i*300 + c -(a*23));
    let y = 100*a*cos(i*100 + b * c);
    
    let xx = 15*PI*cos((cef+30)*i+z);
    let yy = (45+z%10)*PI*tan((cef-30)*i+z);
    
    stroke(0);
    point(x,y);
    point(xx,yy);
 
  
}
  
  a++;
  b+=0.1;
  c-=5;
  z+=0.01;
  if(1) {
    //cefInc = -cefInc;
  }
  if(cef > 7200) {
    cefInc = -cefInc;
  }
}

 

I personally really appreciate minimalist artworks that is why I created this generative art piece. For me, this piece is about how much mood and tension you can create with almost no visual information at all, and how something that looks quiet and minimal on the surface can still feel alive and constantly shifting underneath. I just wanted to force the focus onto rhythm, contrast, and empty space. I did not use any colors other than black and white to create a sense of sophistication. Also, I think if I added other colors it might be distracting for the audience. It’s meant to be looked at slowly. The longer you stare, the more small patterns and tensions appear between the shapes. 

Code I am particularly proud of:

  let xx = 15*PI*cos((cef+30)*i+z);

  let yy = (45+z%10)*PI*tan((cef-30)*i+z);

I am especially proud of this little detail: z % 10 because it introduces a subtle pulse in the y‑movement, so the motion doesn’t feel flat or robotic. It’s a small trick, but it adds character

 

Reflection:

This generative piece that I made showed me how much I can get out of very little. With just a few evolving variables and some trigonometric functions, I ended up with two overlapping systems of points: one smoother and orbital, the other more unstable and spiky. Their interaction creates a black and white field that feels both structured and slightly out of control, which is exactly the mood I was thinking of. For the future improvements, I would like to make it more interactive for the audience by letting the mouse directly influence the main parameters in my system. For example, the horizontal mouse position could control cef, slowly changing the structure of the tan based pattern, while the vertical position could affect a or z, changing the scale. 



Week 2 – Reading reflection

Casey Reas says that instead of directly painting a picture or sculpting an object, the artist becomes a builder of systems. The final art is just the result of the system the artist built. I strongly agree with this claim. I believe that having direct control over every single detail kills the magic of digital art. Straightforward instructions that create totally predictable, controlled pieces feel useless to me.

However, the same applies to pure randomness. While we might find some meaning in things that are fully random, it’s hard to feel an emotional connection to something that has zero structure. Casey Reas mentions that he finds “white noise” or total randomness boring because it has no intent, and I can really relate to that.

I believe the perfect balance happens when the artist creates a structure that allows for randomness, resulting in art that is controlled yet creative. The artist writes the instructions, but the outcome still has some natural variation. Reas talks about algorithms like Perlin noise as a way to do this: it has randomness, but it creates smooth, “alive” motion within a set of rules, rather than just chaotic jittering.

For me, the beauty of computer art is in the power of this controlled randomness. Sometimes the best part is knowing exactly what algorithms you are using, but being surprised by the result every time you run it. Computers are much better than humans at creating something that is random but still follows a system. This reminds me of Reas’ “Process” series shown in the talk, where simple elements react to each other to create complex, organic forms.

I really want to use this kind of randomness in my work. For example, in my assignment for this week, the code is the same every time I run it, but the shape of the figures, the connections between them, and their speed are different. I can never get the exact same picture twice. I find it extremely cool to create something that looks super “mathematical” but, at the same time, never turns out to be the same thing twice.

Week 2 – Reading Reflection

The video was based on the use of randomness or disorder to create art. The classical way is that art should be ordered, create patterns or should be in a certain way to represent or express something. The video taught us that controlled randomness can also be art and illustrated this with intricate examples. The randomness could be in the form of using a set of numbers, a dice roll or even biological systems. The video also drew my attention to the evolution of “random art” with the improvements in computing capabilities. As computers got better, more control and dimensions could be added to this form of art.

This video raised an interesting question. Is there true randomness? In the artworks, if the software was allowed to run long enough, there was evident convergence and patterns forming. Order could be created from the chaos of randomness and this somewhat contradicts with the message or creating disordered art as a form of expression.  Another concern is the determining the line between art created by an artist and a computer. All the examples required an artist to write some code (or give instructions) and rely on the computer to generate the art. With the onset of AI, where will this line be drawn and at what point does the artist become alien to their own work and relinquish the title of artist to the computer.

 

Week 2 – Generative Artwork

Concept:

I’m very new to the concept of generative art, and so I found myself struggling to come up with an idea for this project. Upon scrolling through some of the resources provided to us, I was inspired by this one artwork in Computer Graphics And Art (May, 1978), “Simulated Color Mosaic” by Hiroshi Kawano, and I liked how randomized the blocks were. Thus, I wanted to try and create an algorithm that would allow for a different randomized result at each run or click. No two patterns would look the same (hopefully). In order to create these blocks to be randomized, however, I needed to find an algorithm that would let me create blocks randomly, or at least have some planned out randomness (reference to the reading… haha).

Artwork:

(Click the screen to create a new pattern!)

Process:

To create this, I had to first come up with how to create a different pattern each time. Thus, I decided to create the variable blocks, so I could perform actions on it. It was an array, so it could hold many blocks that would be generated on each run. The block then had specific elements (blocks.push({ x: 0, y: 0, sz: 600, black: false })); it would start off at a size bigger than the canvas (to create bigger blocks) and then have a condition of black:false to edit the color of each block.

Afterwards, to draw the blocks, it would firstly go through every square, staring with a block and then targeting it to split it in half and so on. For this, I used this condition:

function draw() {
  background(randomColor);

  // go through every square
  for (let i = blocks.length - 1; i >= 0; i--) {
    let b = blocks[i];

    rect(b.x, b.y, b.sz, b.sz);

    if (blocks.length < 400 && b.sz > 30 && random(1) < 0.05) {
      splitBlock(i);
    }
  }
}

function splitBlock(index) {
  let b = blocks[index];
  let newSz = b.sz / 2;

  blocks.splice(index, 1);

  for (let x = 0; x < 2; x++) {
    for (let y = 0; y < 2; y++) {
      blocks.push({
        x: b.x + x * newSz,
        y: b.y + y * newSz,
        sz: newSz,
        black: random(1) < 0.4 ? !b.black : b.black
      });
    }
  }
}

It draws the block, and then to split the block, it checks the array and size to make sure it splits blocks of a certain size (not too big nor small boxes) and under the limit of 400 blocks in the screen (not too high to lag but also at a lower size so you can see more variation in size of bigger blocks). There’s many random possibilities for the blocks splitting to make sure that the pattern is different each time.

Then, to reset the artwork when it is pressed, I used a different function:

function mousePressed() {
  blocks = [{ x: 0, y: 0, sz: 600, black: false }];
}

Originally, I was planning on keeping the artwork black and white (similar to the inspiration). However, after creating the code, I decided to add color to it. However, instead of just having the same color each time, I added code to change color on every reset.

I added two more variables, randomColor and randomColor2. In setup(), before starting to add the blocks, I set the colors to random with this code:

randomColor = color(random(255), random(255), random(255));
randomColor2 = color(random(255), random(255), random(255));

After, I also set this condition:

if (b.black) {
     fill(randomColor2);
   } else {
     fill(randomColor);
   }

I wrote in the code earlier, black: random(1) < 0.4 ? !b.black : b.black. This was to change the colors of some blocks randomly so it wouldn’t all accidentally end up the same color. Finally, I also added the random code again in mousePressed(), so it would reset into different colors again.

This is the final code:

let blocks = [];
let randomColor;
let randomColor2;

function setup() {
  createCanvas(500, 500);
  noStroke();

  randomColor = color(random(255), random(255), random(255));
  randomColor2 = color(random(255), random(255), random(255));

  blocks.push({ x: 0, y: 0, sz: 600, black: false });
}

function draw() {
  background(randomColor);

  // go through every square
  for (let i = blocks.length - 1; i >= 0; i--) {
    let b = blocks[i];

    if (b.black) {
      fill(randomColor2);
    } else {
      fill(randomColor);
    }

    rect(b.x, b.y, b.sz, b.sz);

    if (blocks.length < 400 && b.sz > 30 && random(1) < 0.05) {
      splitBlock(i);
    }
  }
}

function splitBlock(index) {
  let b = blocks[index];
  let newSz = b.sz / 2;

  blocks.splice(index, 1);

  for (let x = 0; x < 2; x++) {
    for (let y = 0; y < 2; y++) {
      blocks.push({
        x: b.x + x * newSz,
        y: b.y + y * newSz,
        sz: newSz,
        black: random(1) < 0.4 ? !b.black : b.black
      });
    }
  }
}

// reset when press screen
function mousePressed() {
  randomColor = color(random(255), random(255), random(255));
  randomColor2 = color(random(255), random(255), random(255));

  blocks = [{ x: 0, y: 0, sz: 600, black: false }];
}
Reflection

The loops were confusing. I spent a a while trying to figure this out (much longer than I would have liked) and I think the outcome is okay, but I definitely want to explore creating more artworks that are more complex. The logic took more time to create than the actual code, but it was fun nonetheless. Next time, I would like to work a bit more with colors and shapes, and create a more interesting animation. It’s okay right now but it could be so much better. I really do like the color combinations I’ve been getting! Maybe I could make a color palette generator for my artworks later… or add more colors to this… we’ll see. I’m still not completely confident about loops and conditionals in Javascript, so I hope to get better with more practice.