dqpfkzu360216 2012-06-23 13:09
浏览 35
已采纳

使用Gmagick创建GIF动画

I have some jpg files i want to create gif animated from them. i cant find useful method in gmagick for this problem. any one know about it?

I need simple example for it. ty

  • 写回答

3条回答 默认 最新

  • dongyang9813 2012-06-23 14:24
    关注

    Gmagick example on how to create a GIF picture from two PNG files:

    $first = new Gmagick("example.0.png");
    $first->setImageformat("gif");
    $first->setImageDelay(100);
    $second = new Gmagick ("example.1.png");
    $first->nextImage();
    $first->addImage($second);
    $first->previousImage();
    $first->write('example.gif');
    

    Example taken from https://bugs.php.net/bug.php?id=59420

    Take care that Gmagick internally keeps track at which image you are, that is why nextImage­Docs is used before adding the second image and why previousImage­Docs is used before writing it to disk.

    Start with this two picture example and then change it to a version that adds pictures from an array and with three pictures. And then finally read the array from a directory from 0 to N pictures (e.g. with glob). Have fun!

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了
  • ¥50 切换TabTip键盘的输入法
  • ¥15 可否在不同线程中调用封装数据库操作的类
  • ¥15 微带串馈天线阵列每个阵元宽度计算
  • ¥15 keil的map文件中Image component sizes各项意思