使用GD库创建动画gif [英] Create animated gif using the GD library

查看:114
本文介绍了使用GD库创建动画gif的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我有大量使用php中的GD库制作的图像资源,或者一堆帧,我如何将它们组合成动画gif?我有一个图像阵列和每秒要添加的帧..

If I've got a bunch of image resources that I made using the GD library in php, or otherwise a bunch of frames, how can I combine these into an animated gif? I've got an array of images and a frames per second I'd like to add..

我不能使用ImageMagick或FFMPEG,如果可能的话,我宁愿只使用GD库.

I can't use ImageMagick or FFMPEG, and I'd prefer to just use the GD library if possible.

显然还提供了对创建GIF动画的支持." ,但我可以似乎找不到有关如何从PHP中访问此文档的文档?

Apparently "Support for creating GIF animations is also available.", but I can't seem to find the documentation on how to access this from within PHP?

推荐答案

在Google上进行的搜索显示,在 http://www.phpclasses.org/package/3163-PHP-Generate-GIF-animations-from- a-set-of-GIF-images.html
该链接需要注册.

Well searching on Google revealed GIFEncoder.class.php found at http://www.phpclasses.org/package/3163-PHP-Generate-GIF-animations-from-a-set-of-GIF-images.html
This link requires registration.

因此,我进行了一些搜索,它包含在code.google.com上的phpvideotoolkit中,可以在以下位置下载:
http://phpvideotoolkit .googlecode.com/svn-history/r6/trunk/phpvideotoolkit/adapters/ffmpeg-php/gifencoder/GIFEncoder.class.php

So i searched a little and it is included in phpvideotoolkit on code.google.com and can be downloaded at:
http://phpvideotoolkit.googlecode.com/svn-history/r6/trunk/phpvideotoolkit/adapters/ffmpeg-php/gifencoder/GIFEncoder.class.php

还有一个错误修复的版本,只需在上面的链接中将文件名更改为GIFEncoder.class.phpvideotoolkit.php.

there is also a bugfixed version just change the file name to GIFEncoder.class.phpvideotoolkit.php in the above link.

我自己还没有尝试过,但是也许它可以帮助您.

I haven't tried it myself but maybe it can help you.

也是一个示例

好运

这篇关于使用GD库创建动画gif的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆