Skip to content

Instantly share code, notes, and snippets.

@viniceosm
Created November 21, 2019 03:18
Show Gist options
  • Save viniceosm/7e3fd26991172a312b6168e3b5bbb080 to your computer and use it in GitHub Desktop.
Save viniceosm/7e3fd26991172a312b6168e3b5bbb080 to your computer and use it in GitHub Desktop.
rotate gif image python
from PIL import Image
name_image = "20181023_115428129.gif"
im1 = Image.open(name_image)
frames = []
for frame in range(0, im1.n_frames):
im1.seek(frame)
im2 = im1.rotate(90, resample=Image.BICUBIC, expand=True)
frames.append(im2)
frames[0].save("rotated" + name_image, format='GIF', append_images=frames[1:], save_all=True, loop=0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment