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

查看:38
本文介绍了使用 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 上仔细搜索发现 GIFEncoder.class.php 位于 http://www.phpclasses.org/package/3163-PHP-Generate-GIF-animations-from-一组 GIF 图像.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.

在code.google.com上php文件的父目录也是一个例子

in the parent directory of the php file on code.google.com is also an example

祝你好运

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

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