李旭分享 http://blog.sciencenet.cn/u/lixujeremy 代码与散打爱好者!

博文

Python: Create GIF Image

已有 5505 次阅读 2015-5-18 16:07 |个人分类:Python|系统分类:科研笔记| GIF

The Graphics Interchange Format (better known by its acronym GIF /ˈdʒɪf/ or /ˈɡɪf/) is a bitmap image format that was introduced by Compu Serve in 1987 and has since come into wide spread usage on the World Wide Web due to its wide support and portability.

The format supports up to 8bits per pixel for each image, allowing a single image to reference its own palette of up to 256 different colors chosen from the 24-bit RGB color space. It also supports animations and allows a separate palette of up to 256 colors for each frame. These palette limitations make the GIF format less suitable for reproducing color photographs and other images with continuous color, but it is well-suited for simpler images such as graphics or logos with solid areas of color.

如图 1所示,5张相同尺寸的图片合成为一张动态GIF格式文件。

1

代码分别设置时间延迟.1.5秒,运行结果如图 12

1 

2

 

附上测试数据及代码(mkgif.rar)。图片人物即是博主本人参加学校2015年运动会1500米比赛冲刺的瞬间。全程用时6′25″37,本人比赛速度是(1500/385.62)=3.89m/s。



References

[1] GIF, from Wikipedia, the free encyclopedia.

[2] Make Animated Gifs In Python.

[3] 把图片列表合成一个GIF动画图片.



https://wap.sciencenet.cn/blog-1148346-891063.html

上一篇:Python: Installing images2gif Package
下一篇:Fortran: FORTRAN Programming Environment For Windows
收藏 IP: 202.112.90.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-5-21 22:51

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部