Here we look at a set of quick and easy transformations that are typical of the operations we would need in a photo viewer.
Execute the following program and see the results in /constr/picsx
.
# image_flips_1.py #>>>>>>>>>>>>>> import Image im_1 = Image.open("/a_constr/pics1/dusi_leo_1.jpg") im_out_1 = im_1.transpose(Image.FLIP_LEFT_RIGHT) im_out_2 = im_1.transpose(Image.FLIP_TOP_BOTTOM) im_out_3 = im_1.transpose(Image.ROTATE_90) im_out_4 = im_1.transpose(Image.ROTATE_180) im_out_5 = im_1.transpose(Image.ROTATE_270) im_out_1.save("/a_constr/picsx/dusi_leo_horizontal.jpg") im_out_1.save("/a_constr/picsx/dusi_leo_vertical.jpg") im_out_1.save("/a_constr/picsx/dusi_leo_90.jpg") im_out_1.save("/a_constr/picsx/dusi_leo_180.jpg") im_out_1.save("/a_constr/picsx/duzi_leo_270.jpg")
18.219.239.118