Python图像处理之黑人抬棺材(gif图片制作)
1.利用Python制作gif图片(引用第三方库“imageio”,没有的要先安装)
代码(参考链接:https://blog.csdn.net/ZT7524/article/details/88928005)
import imageio def create_gif(image_list, gif_name, duration = 1.0): frames = [] for image_name in image_list: frames.append(imageio.imread(image_name)) imageio.mimsave(gif_name, frames, ‘GIF‘, duration=duration) return def main(): #这里放上自己所需要合成的图片 image_list = [‘tai1.jpg‘, ‘tai2.jpg‘, ‘tai3.jpg‘,‘tai4.jpg‘,‘tai5.jpg‘,‘tai6.jpg‘,‘tai7.jpg‘,‘tai8.jpg‘,‘tai9.jpg‘,‘tai10.jpg‘,‘tai11.jpg‘,‘tai12.jpg‘,‘tai13.jpg‘,‘tai14.jpg‘] gif_name = ‘new.gif‘ duration = 0.1 create_gif(image_list, gif_name, duration) if __name__ == ‘__main__‘: main()
效果图
相关推荐
YENCSDN 2020-11-17
lsjweiyi 2020-11-17
houmenghu 2020-11-17
Erick 2020-11-17
HeyShHeyou 2020-11-17
以梦为马不负韶华 2020-10-20
lhtzbj 2020-11-17
夜斗不是神 2020-11-17
pythonjw 2020-11-17
dingwun 2020-11-16
lhxxhl 2020-11-16
坚持是一种品质 2020-11-16
染血白衣 2020-11-16
huavhuahua 2020-11-20
meylovezn 2020-11-20
逍遥友 2020-11-20
weiiron 2020-11-16