We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpVideo Capture,  Movie Playback,  Vision Libraries › Video Trails / Echo effect using blend mode
Page Index Toggle Pages: 1
Video Trails / Echo effect using blend mode (Read 1208 times)
Video Trails / Echo effect using blend mode
Jun 2nd, 2010, 11:03pm
 
I'm working on a simple program to create trails for pre-visualizing light painting photography. The code works, but I find the image 'bleeds' toward to lower right of the frame - an undesired effect. Any ideas why this might be happening?

Thanks in advance
Kim


Code:

import processing.video.*;

Capture cam;
int[] maskArray;
static final int blendFactor = 255;
PImage previousFrame;
int capWidth = 640;
int capHeight = 480;


void setup() {
 size(capWidth, capHeight);
 frameRate(24);

 maskArray = new int[capWidth * capHeight];
 Arrays.fill(maskArray, blendFactor);
 cam = new Capture(this, capWidth, capHeight);
}


void draw() {

  previousFrame = get();
   previousFrame.mask(maskArray);
     
   cam.read();
   image(cam, 0, 0, 640, 480);
   
    blend(previousFrame, 0, 0, capWidth, capHeight, 0, 0, capWidth, capHeight, LIGHTEST);
}



Re: Video Trails / Echo effect using blend mode
Reply #1 - Jun 3rd, 2010, 10:03pm
 
Someone figured out the problem - seems to be a bug in the blend method (Thanks Josh!)

Code:
blend(previousFrame, 0, 0, capWidth-1, capHeight-1, 0, 0, capWidth-1, capHeight-1, LIGHTEST);
Page Index Toggle Pages: 1