I'm converting a gif into image sequences and that's working, but I want to resize the images then save them, I put the maximum width and height and I calculated the ratio and then resize the images, but the images are the same as before, here's my code:
from PIL import Image, GifImagePlugin
imageObject = Image.open("my.gif")
print(imageObject.n_frames, "frames")
print(imageObject.size)
count = 1
max_wh = 300 #the maximum height and width
width, height = imageObject.size
ratio = min(max_wh/width, max_wh/height)
print(height, width, ratio, int(width*ratio))
for frame in range(0, imageObject.n_frames):
imageObject.seek(frame)
imageObject.resize((int(width*ratio), int(height*ratio)), Image.ANTIALIAS)
imageObject.save(f"a_{count}.png")
count += 1