A mask object can be created with few tools borrowed from photo blend automatic mask

blend1.jpg (197.36 KiB) Viewed 11226 times

then the mask is automatically created

blend2.jpg (182.08 KiB) Viewed 11226 times

And to simulate photo blend type of blending we can use harmonic blend

blend3.jpg (182.44 KiB) Viewed 11226 times

So what we did? created mask, merged it with the main image and then use harmonic blend to blend it to different background.

Masks can be also used as "masks" like in photoshop layer mask (or selection) where the effect is applied only within the mask. The idea is very simple, any group that we create can have a mask and that mask will be applied to all objects in the group.So here we blur main image and shift its hue, but apply the inverse mask to the group which means the effects will be applied only to background.

Here is the masking idea applied to creating bokeh blur.We cannot really simulate real lens blur with a gaussian blur. To correctly simulate lens and how the shape of aperture affect blur we will use FFT convolution driven by a camera aperture like kernel (hexagon). Then we will mask it with a foreground mask to apply it on a background..

mask2.jpg (74.99 KiB) Viewed 11224 times

So how is the FFT convolution different from normal blur? Pretty significantly. Here is a better image where it will be more obvious:

gaussianvsfft.jpg (68.71 KiB) Viewed 11224 times

I think it is pretty obvious that the gaussian blur looks simply "blurred" while the FFT Convolution looks "defocused" as with a camera lens.