Here is how to build a “matte blur”, which is a blurring method that will ONLY blur inside of the matte and not incorporate pixels outside of the matte. I’m posting it here becuase I used to post it every few months on the facebook page and it was always popular.
draw your matte
combine your fill and matte with a COMP node by plugging the fill into the red input and the matte into the first blue input. You don’t need to change any settings. This creates what we in the biz call a “multiplied fill”, but is also often called a “premultiplied fill” by fans of unnecessary prefixes.
plug both COMP outputs (fill and matte) into a regular old BLUR node (you can use any blur-type node provided it does not mess with the color, so if you use the defocus setting make sure highlight gain is set to 1), and wind up the blur.
plug both BLUR outputs (fill and matte) into another COMP node, same as you did before, but this time set the output’s fill state to “unpremultiplied” (which any sane person would call “divded” but I digress)
with yet another COMP node, plug your source image into the back input (green), your divided (or, um, un-pre-multiplied) fill into the red front input and your original matte into the first matte output. like the first comp node, you do not need to adjust any of the settings on the node. An ACTION node works just as well.
and there you go: a matte blur.
There are muliple matchbox shaders (y_blurs, and K_BlurMask) that do exactly this under the hood and work great.
Nonetheless, knowing how this works is very useful.
ok, I’m probably an idiot but what is the benefit to this method over Use Matte in the Blur node? Please feel free to mock me for missing the point. Or for any.other reason.
The way “use matte” works is it blurs the image and then comps it through the matte. The problem with that is if you have a color near the edge of your matte, it will be blurred into the masked region. For example, if you are doing beauty work on someone’s nose, the dark area of their nostril could get blurred into your masked region.
by doing the “roll your own” you isolate ONLY the colors inside the matte, so when blurred no other colors in the area are incorporated.
With the attached pic I applied both, and you can see the difference.
Thank you. This one would be a real win for the community, even if there are multiple matchboxes that do this. Native-built functions are a good thing because people don’t wade into Matchbox Town until they know what they want.