var fingers;

function setup() {
  createCanvas(320, 240);
  fingers = createVideo(['../fingers.mov', '../fingers.webm']);
  fingers.loop();
  fingers.hide();
  noStroke();
  fill(0);
}

function draw() {
  background(255);
  fingers.loadPixels();
  var stepSize = round(constrain(mouseX / 8, 6, 32));
  for (var y = 0; y < height; y += stepSize) {
    for (var x = 0; x < width; x += stepSize) {
      var i = y * width + x;
      var darkness = (255 - fingers.pixels[i * 4]) / 255;
      var radius = stepSize * darkness;
      ellipse(x, y, radius, radius);
    }
  }
}
