how to overlay many images with alpha channel transparency

Oct 11, 2009 at 10:56pm

how to overlay many images with alpha channel transparency

Hi all, I’ve done quite a bit of trawling but cant find the information I need – its probably elementary and I just cant see the wood for the trees.

I want to layer images over each other, with each layer using the alpha channel to control the transparency as an image sits over the previous layer(s).

Is it the blending flag, in which case would anyone be so kind to provide a working example? Do I have to scale the RGB values by the alpha channel? I’m a bit lost – help!

Thanks

#45817
Oct 12, 2009 at 7:58pm

jit.alphablend?

here’s an example i give my class:

– Pasted Max Patch, click to expand. –
#165188
Oct 12, 2009 at 8:49pm

Thanks for the reply and the patch, much appreciated.

I’ve had a good fiddle around with jit.alphablend, and still cant work out how to achieve the effect I want. I want to do something like this:

http://img527.imageshack.us/img527/1655/jitterwish.gif

So not to blend images, but to stack them up with some pixels “see-through”.

My concepts of video processing are probably a bit amiss, I’m very good with sound but fairly green to graphics and even photoshop etc. If possible it would be great to know a way to stack videos via a junction with multiple inputs, rather than a two way box. Curse demanding feckless newbs.

#165189
Oct 13, 2009 at 2:47am

Sounds like a job for luminance keying. Check the examples/jitter-examples/video/keying subdirectory in the Max5 Folder- specifically the jit.lumakey- examples.

S.

#165190
Oct 13, 2009 at 9:59pm

Do the images have an alpha mask? If so, jit.alphablend is exactly what you need. For three layers, you will need 2 jit.alphablend objects. If not, you will need to do some sort of keying.
Alpha blending can also be done using OpenGL with several jit.gl.videoplane objects with @blend_enable 1.

#165191
Oct 13, 2009 at 10:15pm

Many thanks for the helps.

It seems jit.lumakey is giving me an instant result to work with, which is great for learning some stuff. I cant quite work out how to do it with jit.alphablend but I have not given tutorial 29 its due attention. How come transparent regions of my png image are not transparent out the box? I need to read the info that is in the manual about alpha masking.

I’d really like to use jit.gl.videoplane though I spent quite some time messing around with this and not really getting very far, anyone know any relevant examples for alpha compositing with jit.gl.videoplane? If anyone has the time and willingness to construct me an example patch I’d be eternally grateful!

#165192
Oct 15, 2009 at 10:15pm
#165193

You must be logged in to reply to this topic.