Tag Archives: algorithms

Algorithms – Processing Practice


Learning Processing is no easy task – unless you are force to, by it being a part of your University class, so while I continue to look at how processing uses algorithms to produce anything – let us have a look at some example of how repetition and variations are produced from processing, jumping straight into it seems to be the way to do it (well it’s the way I get told).

The following code is for a multiple random, coloured, Pikachu Picture:

//declare image object
PImage img;
// set up
void setup () {
// canvas size
size(500, 600);
// Make a new instance of a PImage by loading an image file
img = loadImage (“/Users/jb523/Desktop/Pikachu.jpg”);

void draw () {
// Draw the image to the screen at coordinate (0,0)
for (int row = 0 ; row < 5 ; row = row + 1) {
for (int count = 0 ; count < 5 ; count = count + 1) {
tint(random(255), random(255), random(255));
image(img, count*100,row*120, 100, 120);

The indication of the line that starts with ‘tint’ indicates a random colour to each individual picture as well as changing the colour rapidly – below are 3 screenshots that show the change in colour – using only the process above:

Pikachu Random(255)

Each line represents a piece of information that tells the computer what to do – the lines are broken into a command and a function. If we just change the code we can change the appearance of how we want something to look.

What if we wanted a gradual change from black to anything, going from the top left to the bottom right using colour as a transition, we would get:

Pikachu Random(count x row x 51)The only change made was in the “tint” command, instead of random colours per each picture we made the process start at black and multiple by a number to get another colour.

Continuing the change of the “tint” we can make the tint all one colour, shown:

Pikachu background change
We can even change the columns to individual colours while using grey-scale to get to white.

Pikachu shade black to whiteWhile I find Processing difficult, the creations – even if nothing useful are still interesting. This isn’t my strong point, though I enjoy doing it and exploring what processes I can explore and the things I create.


Algorithm and Computation in Art


Art today has been able to utilize technology and create something more than just paintings and drawings – the way that art use to be created has changed and we are seeing new developments in art coming from the use of technology.

At the base of all art creations there lies an algorithm and/or process in the development of the work being created. These processes and algorithms have moved to technology and the impact is a new form of creativity and expression. Creating “Contemporary Art” through researching science and adding computational power we discover new algorithms.

Looking at Murray McKeich’s “P zombie” there are indications of a human-style presence being consumed by or created by nature. Technology at its most creative – by algorithms input by humans result in a “back to nature” type creation.

PzombieBy understanding the processes and finding algorithms that computers work by we can see that every basic process people use to live their lives, to achieve a result follows an algorithm. By using computers, and exploring how computers follow instructions through the use of simple algorithms we relate that to other aspects of our lives – showing us that algorithms exist outside of art, computers have facilitated the exploration of algorithms outside art and, exposing algorithms present in our daily technological life.

Understanding how a computer works and processes there is the need to know how computers use commands in order to create something. Looking at the Processing website we will be able to understand the basics in creating a process and algorithm in order to create art – or an attempt, as what is shown below (image and code – code may be off).

Hello Worldsize(400, 400);
background(70, 120, 170);
fill(80, 140, 80);
triangle(200, 10, 10, 390, 390, 390);
fill(255, 255, 255);
textFont(createFont(“Impact”, 38));
text(“HELLO WORLD, THIS IS ME”, 200, 200);

fill(255, 255, 255);
textFont(createFont(“Impact”, 20));