figure - on macostransparent pixels are used for the gaps instead the rotate(method has an optional expand keyword argument that can be set to true to enlarge the dimensions of the image to fit the entire rotated new image for exampleenter the following into the interactive shellcatim rotate( save('rotated png'catim rotate( expand=truesave('rotated _expanded png'the first call rotates the image degrees and saves it to rotate png (see the image on the left of figure - the second call rotates the image degrees with expand set to true and saves it to rotate _expanded png (see the image on the right of figure - figure - the image rotated degrees normally (leftand with expand=true (rightyou can also get "mirror flipof an image with the transpose(method you must pass either image flip_left_right or image flip_top_bottom to the transpose(method enter the following into the interactive shellcatim transpose(image flip_left_rightsave('horizontal_flip png'catim transpose(image flip_top_bottomsave('vertical_flip png'like rotate()transpose(creates new image object here we pass image flip_left_right to flip the image horizontally and then save the result to horizontal_flip png to flip the image verticallywe pass image flip_top_bottom and save to vertical_flip png the results look like figure -