9951 explained code solutions for 126 technologies


python-pillowHow to rotate image 180 degrees


from PIL import Image, ImageEnhance

im = Image.open('/var/www/examples/heroine.png')
im = im.rotate(180)

im.show()ctrl + c
PIL

import Pillow package modules

Image.open

open given image with Pillow

.rotate(

rotate given image

180

degrees to rotate given image by

.show()

displays resulting image