Forums > Jitter

how to overlay many images with alpha channel transparency

October 11, 2009 | 10:56 pm

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


October 12, 2009 | 7:58 pm

jit.alphablend?

here’s an example i give my class:

– Pasted Max Patch, click to expand. –

October 12, 2009 | 8:49 pm

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.


October 13, 2009 | 2:47 am

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.


October 13, 2009 | 9:59 pm

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.


October 13, 2009 | 10:15 pm

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!


October 15, 2009 | 10:15 pm

I posted a patch on this thread that might help you.

http://www.cycling74.com/forums/index.php?t=msg&th=41396&start=0&rid=2688&S=62f2c26e776d5c8ff2c83b52591b52bb

Best,
Andrew B.


Viewing 7 posts - 1 through 7 (of 7 total)