Skip to content

Instantly share code, notes, and snippets.

@errete
Created May 5, 2014 20:25
Show Gist options
  • Save errete/9df6d1393e533c551561 to your computer and use it in GitHub Desktop.
Save errete/9df6d1393e533c551561 to your computer and use it in GitHub Desktop.
Processing.org code for the cover of http://8tracks.com/danielrt/44
int pt[][][]=new int[90][90][2];
int i, j, k, gray;
int r[]=new int[2];
PGraphics n44; // raster "44."
PFont fnt=createFont("HelveticaNeueLTStd-Bd", 54);
color c[]={
color(255, 255, 215),
color(104, 102, 116),
color(121, 99, 85)
};
void setup() {
size(1440, 1440);
background(48, 40, 44);
n44=createGraphics(90, 90);
n44.beginDraw();
n44.background(0);
n44.fill(255);
n44.textFont(fnt);
n44.textAlign(CENTER, TOP);
n44.text("44.", 45, 40);
n44.endDraw();
strokeWeight(1);
noFill();
for (i=0; i<90; i++) {
for (j=0; j<90; j++) {
pt[i][j][0]=i*16+round(random(12));
pt[i][j][1]=j*16+round(random(12));
}
}
for (i=2; i<88; i++) {
for (j=2; j<88; j++) {
gray=round(red(n44.pixels[i+j*n44.width])/64);
for (k=-1; k<gray; k++) { // -1 ???
r[0]=i+round(random(4))-2;
r[1]=j+round(random(4))-2;
stroke(c[round(random(2))], round(random(192))+32);
line(
pt[r[0]][r[1]][0],
pt[r[0]][r[1]][1],
pt[i][j][0],
pt[i][j][1]
);
}
}
}
save("44.png");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment