Added Intensity parameter to pixels averaging algorithm