Sunday, November 25, 2012

Facebook glitch cover generator made with Processing

//FaceBook glitch cover generator
//click to save image

int N=0;

void setup(){
size (851,315);
background(255);
}

void draw(){
  
  Set();
  Glitch(); 

}

int r(int a){
  return int(random(a));
}

void mouseReleased (){
  N++;
  save("glitchCover"+ (N)+".tif");
}

void Set() {
  for (int i=0; i<10; i++) {
    int x = r(width);
    int y = r(height);
    set(x+r(50)-1,y+r(3)-1,get(x,y,r(99),r(30)));
  }
}

void Glitch() {
  if (frameCount%(r(250)+1) == 0) {
    int lineDensity = int(noise(frameCount)*width);
    for (int i=0; i<width*1.5; i+=lineDensity) {
      stroke(random(0, 255),random(0, 255),random(0, 255));
      strokeWeight(random(1,50));
      line(-100,i,i,-100);
    }
  }
}

No comments:

Post a Comment