Skip to content

Instantly share code, notes, and snippets.

@errete
Created July 19, 2014 12:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save errete/b47c279456573e520592 to your computer and use it in GitHub Desktop.
Save errete/b47c279456573e520592 to your computer and use it in GitHub Desktop.
Processing.org code for the cover of http://8tracks.com/danielrt/51
int i, j, k, gray;
int[] d=new int[2];
int[][][] disp=new int[90][90][2];
PGraphics n51;
PFont fnt=createFont("HelveticaNeueLTStd-Bd", 54);
void setup() {
size(1440, 1440);
background(31, 53, 71);
strokeWeight(1);
for (i=0; i<90; i++) {
for (j=0; j<90; j++) {
disp[i][j][0]=i*16+8-round(random(16));
disp[i][j][1]=j*16+8-round(random(16));
}
}
n51=createGraphics(90, 90); // raster "51."
n51.beginDraw();
n51.background(0);
n51.fill(255);
n51.textFont(fnt);
n51.textAlign(CENTER, TOP);
n51.text("51.", 45, 40);
n51.endDraw();
for (i=1; i<89; i++) {
for (j=1; j<89; j++) {
gray=round(red(n51.pixels[i+j*n51.width])/16);
for (k=0; k<round(random(gray*6))+2; k++) {
stroke(237, 53, 71, 32+round(random(64)));
d[0]=floor(random(3))-1;
d[1]=floor(random(3))-1;
line(
disp[i][j][0],
disp[i][j][1],
disp[i+d[0]][j+d[0]][0],
disp[i+d[1]][j+d[1]][1]
);
}
}
}
save("51.png");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment