Let’s learn how to rotate image around custom point in Pillow.
Pillow rotate image
To rotate an image around custom point you just need to move the center of image to the different point. This is basically to change the center of the image to the different coordinates.
By default the rotate is around the left upper point of an image. By parameter you are able to set a new coordinates.
from PIL import Image my_image = Image.open("C:/Users/Pythoneo/Documents/image.jpg") rotated_image = my_image.rotate(180, center=(500, 500)) rotated_image.show()
Center parameter set a new center coordinates 500 right and 500 down.