import processing.video.*; import processing.pdf.*; Capture myCapture; void setup() { size(320, 240); background(0); smooth(); myCapture = new Capture(this, 320, 240, 30); myCapture.loadPixels(); // The name of the capture device is dependent those // plugged into the computer. To get a list of the // choices, uncomment the following line // println(Capture.list()); // And to specify the camera, replace "Camera Name" // in the next line with one from Capture.list() // myCapture = new Capture(this, width, height, "Camera Name", 30); } void captureEvent(Capture myCapture) { myCapture.read(); } void draw() { //image(myCapture, 0, 0); //circle filter for (int i = 0; i < width*height; i += random(1, 30)){ color p = myCapture.pixels[i]; float r = red(p); float g = green(p); float b = blue(p); //float bwx = (r + g + b) /3; float circle = map(b, 0, 255, 0, 50); int x = i % width; int y = i / width; if (y % 3 == 0){ fill(r, g, b); ellipse(x, y, circle, circle); } } } void keyPressed(){ if (key == 'b'){ beginRecord(PDF, "lines.pdf"); background (0); } else if (key == 'e') { endRecord(); exit(); } }