I\'m trying to rotate an image in Python using PIL and having the expand argument to true. It seems that when the background of my image is black, the resulting image saved
There is a parameter fillcolor in a rotate method to specify color which will be use for expanded area:
fillcolor
rotate
white = (255,255,255) pil_image.rotate(angle, PIL.Image.NEAREST, expand = 1, fillcolor = white)
https://pillow.readthedocs.io/en/stable/reference/Image.html#PIL.Image.Image.rotate