Overlay image onto video with transparent background

asked 2016-11-29 04:16:39 -0500

I need to overlay an image on a video. The image should not be transparent, but the background of the image should be completely transparent.

I realize I could loop through every pixel in the image, and set the the individual pixels in the video where the color is not equal to the background color. I hope there is an easier way to do this.

edit retag flag offensive close merge delete



there is no such thing as transparency in video, you'll have to come up with your own blending formula here.

(you could e.g. make a mask from color==bg, and use that with copyTo())

berak gravatar imageberak ( 2016-11-29 04:54:27 -0500 )edit