from PIL import Image
def rotation_naive(chemin_image):
default_img=Image.open(chemin_image)
new_img = Image.new('RGB', default_img.size, 'white')
for w in range(default_img.width):
for h in range(default_img.height):
c = default_img.getpixel( (w,h) )
pos = (default_img.width-1-h, w)
new_img.putpixel(pos, c)
return new_img
i = rotation_naive('lion.jpg')
image.save('rotation.jpg')