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 & HelpSyntax Questions › quicktime movies and transparent backgrounds
Page Index Toggle Pages: 1
quicktime movies and transparent backgrounds (Read 1365 times)
quicktime movies and transparent backgrounds
Sep 1st, 2009, 4:40am
 
Hey,

Does anyone know if you can display quick time movies through processing with transparent backgrounds? As I have a script that is playing a quick time movie that was saved with a transparent background, but it shows up with a white background.


Heres my code:

import processing.video.*;
Movie onClick;
Movie constant;

void setup(){
 size(1000,800,P3D);
 background(0);
 onClick = new Movie(this, "Comp 1.mov");
 constant = new Movie(this, "Comp 1.mov");
}

void draw(){
 background(0);
 int posx = mouseX - 200;
 int posy = mouseY - 100;

 image(onClick, posx,posy);
 image(constant, 100,100);

 if(mousePressed){
   alpha(0);
   onClick.loop();
 }
 else{
   onClick.noLoop();
 }
}

void movieEvent(Movie m) {
 m.read();
}


Any help would be really appreciated
Re: quicktime movies and transparent backgrounds
Reply #1 - Sep 1st, 2009, 5:15am
 
It's odd that this question seems to crop up regularly...  What do you expect to see in the transparent area?  Transparency isn't anything more than an absence of colour, so you'll probably just see the background colour of the sketch.  If not I guess you might be able to use the transparency information to mask out that section of video and put something else in the background...  What you won't get is a transparent applet that, for example, displays your desktop in the transparent area...
Re: quicktime movies and transparent backgrounds
Reply #2 - Sep 1st, 2009, 5:42am
 
Hi there, have you tried inserting each frame of the movie into an array as an SVG? This might help. Otherwise you could use after effects to take some areas out via a keyer, then use processing to recognise the colour then replace it with either a transparent image or transparent pixels, which would show the background through.

Hope this helps
Re: quicktime movies and transparent backgrounds
Reply #3 - Sep 1st, 2009, 5:56am
 
blindfish wrote on Sep 1st, 2009, 5:15am:
It's odd that this question seems to crop up regularly...  What do you expect to see in the transparent area  Transparency isn't anything more than an absence of colour, so you'll probably just see the background colour of the sketch.  If not I guess you might be able to use the transparency information to mask out that section of video and put something else in the background...  What you won't get is a transparent applet that, for example, displays your desktop in the transparent area...


Um not quite sure what you mean.. I saved my quick time movie from after effects with a transparent background.  When I play it through my processing script it is surrounded by a big white box, the area that is meant to be transparent is white.  Whereas I just want it to be my animation against the background color specified in my processing script....
Re: quicktime movies and transparent backgrounds
Reply #4 - Sep 1st, 2009, 7:36am
 
Then I guess it's likely that the video library you're using doesn't support the transparency in the Quicktime video files...  In which case I guess you'll need to do some processing at the pixel level to remove the white pixels and make them transparent...  Unless one of the video libraries already supports colour masking?
Re: quicktime movies and transparent backgrounds
Reply #5 - Sep 1st, 2009, 9:25am
 
Aah, interesting, so After Effect can really do videos with transparency I found out a... video tutorial showing them: Understanding Straight vs. Premultiplied with good examples on how to use them against interesting background.
Somehow, it is a bit like animated Gifs with transparency...

I haven't followed the whole video. I dislike video tutorials, much slower than when reading and I have difficulties to grasp spoken English, even if orator there seems to be quite understandable.
But if I understood correctly, there is at least two methods to do such videos, one not well handled by some softwares.
And I don't know if such video can be played or used by something else than these video editing softwares.
As blindfish points out, if the video codec doesn't know how to handle transparency information, you are out of luck.
Page Index Toggle Pages: 1