Masks in Quartz Composer

marcofilipevieira's picture

Hi there, I wonder if someone can give me a help with masks. I have this composition, which I use a circular mask, and then I want to have different animations only inside that circular mask. Here's the composition I'm working attached. Can anyone give me a help please?

PreviewAttachmentSize
mask.qtz29.66 KB

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

cybero's picture
Re: Masks in Quartz Composer

Couldn't resist doing a quick one before I sat down to my salad chaude.

This doesn't actually employ a mask, but I think it does what you want.

There are other solutions though.

Do experiment. :-)

PreviewAttachmentSize
greenobjectsinwhitecircle.qtz30.85 KB

marcofilipevieira's picture
Re: Masks in Quartz Composer

Hey, thank you for your help. But the problem here (which I forgot to mention) is that the radius of the circle can be different. And if the radius is different, than I have to change again the x and y velocity of the particle system. =/ So, my goal here, is: if I change the radius of the circle, the particle system should be always inside the circle. So, I would like the x and y velocity of the particle system to change automatically with the circle's radius.

cybero's picture
Re: Masks in Quartz Composer

marco - upon some closer examination it did become readily evident to me that you were initially seeking a more effective solution than the 'quick and dirty fix' that I applied. I did however get that you wanted the green particle system within the circle and not breaking its bounds. What wasn't ever going to be readily evident to this bear of little brain was that you wanted to concurrently compute the radius up | down with the velocity of the particle system; try using a CICircle Generator with such a computation, or an Image Resizer patch upon your own circle image if that is especially important to your composition.

jersmi's picture
Re: Masks in Quartz Composer

Have you tried putting particle system inside a render in image patch, then using the rendered particles as sprite image and circle as sprite mask image?

cybero's picture
Re: Masks in Quartz Composer

Actually I gave that a quick try jersmi, but the particles remained whilst the circle disappeared , besides, with that and other similar configurations the particles still overlap what is intended to be the masking shape.

marco, I think you need to make that circle mask very obvious until you've fine tuned the way that your particular exploitation of the Particle System patch is sorted out, including the synchronising of the velocity with the apparent radius of the circle.

marcofilipevieira's picture
Re: Masks in Quartz Composer

Hey guys. Thank you all for your attention. I've came up with this. Now, the only thing I need, is to adjust the velocities of the particle system with the radius. I'll use some mathematical expression for this.

Thank you :-)

PreviewAttachmentSize
mask.qtz21.31 KB

bAjA's picture
Re: Masks in Quartz Composer

Well done sorting it out with a ci filter. Quartz has a built in patch called mask to alpha- which creates a alpha channel based on a gray scale image, which you can then plug into a the mask image input on a sprite... (this is what jersmi was saying) See attached qtz, where i also connected the radius to the particle velocity- which might be what your looking for.

PreviewAttachmentSize
mask-to-alpha.qtz23.43 KB

marcofilipevieira's picture
Re: Masks in Quartz Composer

Ya, that's right! :D Thank you very much, that really what I wanted. Thanks :-)

sleekgreek38's picture
Re: Masks in Quartz Composer

hey guys, I'm trying to layer two videos and have the top one transparent wherever it is black.. or white.. or what ever color i choose to "key" out. i've been searching the forum and cant find the info i need.. I'm close but can't quite figure it out. any help would be much appreciated.

fredericklibereau's picture
Re: Masks in Quartz Composer

Interesting, this is my version with output parameters (zoom mask, gaussian blur...) Thanks all for this post, and good job Cybero

PreviewAttachmentSize
mask.qtz31.36 KB

photonal's picture
Re: Masks in Quartz Composer

How about this one, whilst drinking my Café Chaud before going to work :)

Rendered using a 'Render in Image' with a mask on the Billboard.

PreviewAttachmentSize
Particle Mask.qtz44.2 KB