Rotating image in python: extrapolate background color
问题 I am rotating an image with the following python code: from PIL import Image img = Image.open('banana.jpg') rotated = img.rotate(10) rotated.save('banana-rotated.jpg') This makes the following transformation: to As you can see, the background is black. This question asks how to fill the background with a specific color. However, I would like to fill the background with the color of the image. Because I need to rotate many images, I do not want to set the background to a fixed color. Is there