We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I'm trying to create an effect like the image above which I have done by crudely exporting a frame then loading it and blending it - which isn't very memory/processor efficient. I'm wanting to know what the best way producing this effect would be with the pixel array. ie - how to store the pixels[] of a single frame.
thanks.
import processing.video.*;
PImage test, test2;
float FPS;
int count;
int mod;
int rand;
Capture video;
void setup() {
size(640, 420, P2D);
video = new Capture(this, 640, 360, 30);
video.start();
}
void captureEvent(Capture video) {
video.read();
}
void draw() {
FPS = frameRate;
count = ceil(millis()/1000);
mod = count % 5;
background(245, 238, 96);
image(video, 0, 0, 640, 420);
loadPixels();
for (int i = 0; i < pixels.length; i++) {
float b = brightness(pixels[i]);
if (b > 97) {
pixels[i] = color (255);
} else {
pixels[i] = color (245, 238, 96);
}
}
updatePixels();
textSize(16);
fill(0);
text(FPS, 50, 50);
text(count, 50, 75);
text(mod, 50, 100);
text(mouseX, 50, 125);
}
Answers
Kf
Thanks for that - much appreciated - I have part of it working. I might need a few days. Cheers