# Computer Graphics and Art (replication assignment)

For this assignment I picked Simulated Color Mosaic by Hiroshi Kawano to recreate in processing:

From the first glance I already knew it would not be as easy as it looks, despite the fact it is made of simple shapes (rectangles).

I first started with trying to recreate it by making rectangles with the values I eyeballed so that whatever comes out looks somehow like the original piece of art. After a couple of rectangles I knew this is not going to work out, as I would spend too much time to place rectangles in the right spots and make them right sized by just eyeballing the values.

I realised I needed exact values and so I was thinking about using Illustrator to help me get the exact coordinates of every corner for every rectangle, so that then I could use rectmode(CORNER) to make a rectangle using two opposite corners. However, I found even easier solution, which was an online website which do the same thing: give me exact coordinates of wherever I click on the image.

So I ended up selecting all the corners I needed, which on the website looked like this:

However, having all the values, I thought it might be a little too tedious and take a bunch of time, since all I was looking at were endless digits and every mistake on my side would cause the whole thing go wrong and the pattern to be different from the original.

So about halfway into recreating the original, a friend of mine suggested thatÂ I make a pattern that looks similar but is not exactly the same, so I wrote this code that creates a similar-looking pattern and changes it 3 times a second.

```void setup() { size(610, 620); background(255); strokeWeight(0); noStroke(); frameRate(3); }```
``` void draw(){ background(255); for (int x=0; x< width; x++) { for (int y=0; y< height; y++) { if (random(1) < 0.0015) { fill(0); } else { noFill(); } rect(x,y,random(50), random(50)); } }```

`}`

This is how one of the endless amount of random patterns it creates looks like

However, with a little help this took me no longer than 10 minutes to write, so I felt like I had to do something more, more specifically finish my first idea of making an exact replica of the original artwork.

It took a while, because my eyes would often get tired and I would make lots of typos, but eventually I recreated Simulated Color Mosaic in processing. This is how my version of it looks :

and here again is the original

There are some minor differences that are not noticeable unless someone takes lots of time comparing them, at some point I just realised its time to give up and stop fixing every minor detail. But if you have lots of spare time, you can take on the challenge and let me know if you found them đŸ™‚

The code for the replica is simply too long to attach and would take ages to scroll through to get to other people’s works, but if anyone is interested- feel free to ask, I will send it directly to you.