Learning Processing 4

processing4_00003 processing4_00087 processing4_00108

Unfortunately due to a family emergency I couldn’t make the workshop this week however I caught up with the work. The following is this workshop’s content.

The workshop expanded upon using functions as seen below but instead of making a vector as beforehand we learnt to load images in and manipulate them – in this case making each pixel move; which makes me think we could pull certain pixels out using functions which would be very interesting for me. In this occasion the images’ pixels move randomly upon a range of 75% of the pixel size. Also upon right click the second image merges into and then replaces the original.

Image manipulation is a huge part of coding, making an image in Illustrator or Photoshop has significant benefits over coding it from scratch and to manipulate these is a big step up so the workshop really helped in this respect. For my project I will be looking at using images and having a very graphic based design. With this.the workshop has significantly helped for my installation.

PImage img1;
PImage img2;

void setup(){
img1 = loadImage(“batman_251.jpg”);
img2 = loadImage(“batman_404.jpg”);
background(0);
size(img1.width, img1.height);
}
PImage imgs[] = {img1,img2};

int s = 5;

void draw(){
img1.loadPixels();
for(int y =0; y<height; y=y+s){
for(int x =0; x<width; x=x+s){

int loc = x + (y*width);
color c = img1.pixels[loc];
//noStroke();
stroke(c,100);
fill(c,20);
rect(x+random(-1,10),y+random(-1,10),s*.75,s*.75);
}
}

fill(255,75);
textSize(50);

if(mousePressed && mouseButton == RIGHT || keyPressed){
img1=loadImage(“batman_404.jpg”);
text(“#404”, width/3,height-10);
} else {img1=loadImage(“batman_251.jpg”);
text(“#251”, width/3,height-10);
}
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s