Skip to content

Language Settings

Video Capture

Capture video from the webcam and display on the canvas as well with invert filter. Note that by default the capture feed shows up, too. You can hide the feed by uncommenting the capture.hide() line.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
let capture;
function setup() {
  createCanvas(390, 240);
  capture = createCapture(VIDEO);
  capture.size(320, 240);
  //capture.hide();
}
function draw() {
  background(255);
  image(capture, 0, 0, 320, 240);
  filter(INVERT);
}
X

creative commons license