Skip to content

Instantly share code, notes, and snippets.

@Bleuje
Created March 4, 2019 16:39
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 Bleuje/907dfc2da1be07fad3edc8ed9cd888ed to your computer and use it in GitHub Desktop.
Save Bleuje/907dfc2da1be07fad3edc8ed9cd888ed to your computer and use it in GitHub Desktop.
OpenSimplexNoise noise;
void setup(){
size(500,500);
background(0);
stroke(255);
noFill();
noise = new OpenSimplexNoise();
}
void draw(){
background(0);
float scale = 0.02;
loadPixels();
for(int x = 0; x<width;x++){
for(int y = 0; y<height;y++){
boolean b = (float)noise.eval(scale*x,scale*y)>0;
float col = b?255:0;
pixels[x + width*y] = color(col);
}
}
updatePixels();
saveFrame("tuto3.jpg");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment