Last active
August 29, 2015 14:07
-
-
Save echophon/7cd96caf963473120c6d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PImage img; | |
void setup(){ | |
size(500,500); | |
smooth(); | |
} | |
void draw(){ | |
background(#000000); | |
for (int ii=0; ii<25; ii++){ | |
for (int kk=0; kk<25; kk++){ | |
pushMatrix(); | |
translate( width/25 * ii -12.5, height/25 * kk-12.5); | |
rect(0,0, random(30),random(30)); | |
popMatrix(); | |
// rotate(0.0001 * frameCount); | |
} | |
} | |
//fakey fake turing patterns - aka "reaction-diffusion" | |
if(frameCount % 1 == 0 && frameCount < 46) | |
{ | |
for(int i = 0; i <60; i++){ | |
//get the base image | |
img = get(); | |
filter(BLUR, 2); //diffusion | |
filter(INVERT); //reaction pt1 | |
//subtract the base image from the diffused version | |
blend(img, 0, 0, width, height, 0, 0, width, height, SUBTRACT); //reaction pt2 | |
} | |
saveFrame("image-###.gif"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment