Oil Painting Effect implementation in C