Log in

View Full Version : Overlaying and Image Over a Movie


MPM
27th June 2008, 10:35
N00b alert..

Apologies if this question has been repeatedly asked, but im having problems overlaying an image over my movie files.

Basically I have a movie, and one image. The image is a grid of squares (black horizontal and vertical lines) over a white background.

I wish to overlay this image over the movie, but have the white background set as transparent. So basically the result will be grid of squares visible over the movie, throughout its entire duration.

I've searched the forum but found no directly relevant info. Other threads are more specific to the fading and fading out of logos.

Although not identical here is my starting point:

src = AVISource("movie.avi")
image = ImageReader("grid.bmp")
Overlay(src, image)

What do i need to add to turn the white background of the image to transparent? All help appreciated.

Cheers,

MPM

Didée
27th June 2008, 11:39
If the grid is truly "black" lines and "white" squares, then there's no need to use transparency. Simply try

> Overlay(src, image, mode="darken")

MPM
27th June 2008, 11:48
If the grid is truly "black" lines and "white" squares, then there's no need to use transparency. Simply try

> Overlay(src, image, mode="darken")

Hi, thanks for your help.


I tried this and it kind of had the right effect. BUT...

The 'lines' became transparent and the 'squares' became black. I tried the opposite, mode="lighten", and got the closest to what im trying to achieve. This made the 'squares' transparent, but the lines became white, i want them to be black.

Any ideas?

Thanks for your time.

MPM

MPM
27th June 2008, 11:50
I just tried mode="subtract" and that seemed to give the desired result!

EDIT: Just realised why mode="darken" did not work, my squares were actually black and my lines were white!