Implemented linear pixels averaging algorithm