Rotate and transpose

rotate and FLIP_LEFT_RIGHT.

rotate expands unless you say otherwise. transpose flips.

Goal

Print sizes after rotate and a flip.

from PIL import Image
im = Image.new('RGB', (40, 20), (0, 128, 64))
print(im.rotate(90, expand=True).size)
from PIL import Image
im = Image.new('RGB', (40, 20), (0, 128, 64))
print(im.transpose(Image.Transpose.FLIP_LEFT_RIGHT).size)
from PIL import Image
im = Image.new('RGB', (30, 30), (200, 40, 40))
plt.imshow(im.rotate(45, expand=True, fillcolor=(0, 0, 0)))
plt.axis('off')
plt.show()
print('ok')
from PIL import Image
print(list(Image.Transpose))