Blurring Non-Uniform Areas I have an image with arbitrary area (the boundary is shown in gray):



I would like to blur just the image within boundaries.

Ordinary blur causes the background proliferating to image and vice versa. This results in dark areas near boundaries of the image:
One simple solution would be to create a binary (0/255) mask of the area you want to blur. Then blur the source image BITWISE AND mask, blur the mask with the same filter and divide them. As pseudocode:

(filter(source &amp; mask) / filter(mask)) &amp; mask