Sketching over every frame of a video
in
Programming Questions
•
11 months ago
I am trying to figure out an efficient way to alter a 28 second clip. There are 711 frames in total.
I am using something similar to pointillism, where a random colored circle is generated based on the pixels of a loaded image.
I then want to string these stills back together into a video.
Surely there has to be a better way to do this than opening each frame individually, saving, then opening the next frame.
Can anyone lend a hand?
Sample frame and current code included below.
- PImage img;
- int smallPoint = 2;
- int largePoint;
- int top, left;
- void setup() {
- size(980, 460);
- img = loadImage("001.jpg");
- noStroke();
- background(0);
- smooth();
- frameRate(30);
- largePoint = min(width, height) / 10;
- // center the image on the screen
- left = (width - img.width) / 2;
- top = (height - img.height) / 2;
- redraw();
- }
- void draw() {
- float t = random(300,700);
- float pointillize = map(t, 0, width, smallPoint, largePoint);
- int x = int(random(img.width));
- int y = int(random(img.height));
- color pix = img.get(x, y);
- fill(pix, 128);
- ellipse(left + x, top + y, pointillize, pointillize);
- }
1