Is it possible to rotate an image around a point that isn't the image center using PIL?
If not what could you folk recommend for me to achieve the desired behavior?
By default, it rotates around the center of the image, to answer the commenter's question. Otherwise, you can specify coordinates, starting from the top left.
from PIL import Image
im = Image.new("RGB", (100, 100))
resultIm = im.rotate(45, center=(25, 25))
See https://pillow.readthedocs.io/en/5.2.x/reference/Image.html#PIL.Image.Image.rotate for documentation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With