Apply convolution with mask for smoothing.