/** * Experiments with edge detection, D. Parson, May 2017. * See https://processing.org/examples/edgedetection.html, * https://processing.org/reference/filter_.html **/ //<>// PImage img ; void setup() { size(1500, 1000, P2D); frameRate(16); // fullScreen(P2D); background(0); } void draw() { if (img == null) { img = loadImage("stone5152x3864.JPG"); // Load the original image // img = loadImage("Hex306090B.png"); img.resize(width, height); // img.filter(INVERT); } // FILTERING HERE CHANGES THE ACTUAL PImage img.filter(POSTERIZE, (frameCount % 18)+2); if (random(0,100) < 50) { img.filter(ERODE); } else { img.filter(DILATE); } image(img, 0, 0, width, height); // filter(BLUR, constrain(16 - abs(32-pframenum), 0, 16)); //filter(POSTERIZE, (frameCount % 18)+2); // filter() here filters the entire display so far // filter(GRAY); // filter(THRESHOLD, 0.5); // filter(ERODE); // Just one application of ERODE or DILATE don't make much change. // But if you apply them repeatedly to the PImage, change is incremental // filter(INVERT); // filter(BLUR,10); println("frameRate = " + frameRate); }