In this section, we will discuss another set of transformations that are done by multiplying appropriate matrices (often expressed in homogeneous coordinates) with the image matrix. These transformations change the geometric orientation of an image, hence the name.
Reflecting an image
We can use the transpose() function to reflect an image with regard to the horizontal or vertical axis:
im.transpose(Image.FLIP_LEFT_RIGHT).show() # reflect about the vertical axis
The next figure shows the output image produced by running the previous line of code:
Rotating an image
We can use the rotate() function to rotate ...