I am adding some codes from google that would help in image processing such as resizing,rotating,cropping,changing the color of the image to gray scale ,changing the dimensions. This can be used in many appplications of object detection or image detection . This works well in google colab .