Image Processing operations in C