Image rotation in Pillow

16.5k Views Asked by At

I have an image and I want to transpose it by 30 degrees. Is it possible to do by using something like the following?

spinPicture003 = Picture003.transpose(Image.Rotate_30)
3

There are 3 best solutions below

0
On BEST ANSWER

To rotate 30 degrees counter clockwise around its center use:

spinPicture003 = Picture003.rotate(30)
0
On

try using rotate() instead of transpose()

0
On

If you want to keep the image size, you can use

spinPicture003 = Picture003.rotate(30)

But if you want to swap the width and height, please use

spinPicture003 = Picture003.rotate(30, expand=1)