Resize animated GIF with PythonMagick

梦想与她 提交于 2019-12-11 05:36:18

问题


I'm using PythonMagick 0.9.3 (cannot switch to PIL) to resize images. It works fine for everything except for animated GIFs.

This is the way how I resize the images at the moment:

orig_image = Image('path/to/animated.gif')
orig_image.resize('..resize string..')
orig_image.write('path/to/thumbnail.gif')

Currently it only resizes the first image of the sequence so the image is no longer animated afterwards. Does anyone have a workaround for my problem?

Thank you!


回答1:


I suppose you have to iterate on all the images that compose the animation, resize them, and recompose the animation after like this (with example for PHP language)



来源:https://stackoverflow.com/questions/5728911/resize-animated-gif-with-pythonmagick

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!