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.
Page Index Toggle Pages: 1
alpha channel movies (Read 549 times)
alpha channel movies
Mar 20th, 2009, 11:44pm
 
I'm trying to play either png or tiff movies that have a valid alpha channel.
I looked here and found some code. I get the problem that the images write on top of each other, rather than having a clear each frame. If I try to use the background statement in the movie event, it does clear, but I get a flickering problem. I would just like the unmasked portion of my movie to play over a red background. here is the code, please let me know what I am doing wrong:

import processing.video.*;
Movie myMovie;

void setup() {
background(255,0,0);
 size(640, 480);
 myMovie = new Movie(this, "baseball.mov");
 myMovie.loop();
myMovie.mask(myMovie);

// myMovie.loop();
}

void movieEvent(Movie myMovie)  
{  
background(255,0,0);
myMovie.read();
myMovie.mask(myMovie);

}  

void draw() {
 
 image(myMovie, 0, 0);
 
}
Page Index Toggle Pages: 1