Resizing GIFs with Wand + ImageMagick

前端 未结 1 620
借酒劲吻你
借酒劲吻你 2021-01-21 04:43

I am using Wand 0.3.7 with ImageMagick 6.8.8-10 to batch-resize some animated GIF files I have. But for some reason, Wand only resizes one frame in the image, leaving the others

相关标签:
1条回答
  • 2021-01-21 05:20

    You might try opening a new target Image and loop every frame into that:

    with Image() as dst_image:
        with Image(filename=src_path) as src_image:
            for frame in src_image.sequence:
                frame.resize(x, y)
                dst_image.sequence.append(frame)
        dst_image.save(filename=dst_path)
    

    works for me.

    0 讨论(0)
提交回复
热议问题