Reading animated GIF in PHP

佐手、 提交于 2019-12-06 14:36:45

Yup. I think the ImageMagick extension should work nicely in your case. I've used it in my PHP codes before, and while I've not used GD before, ImageMagick has been sufficient for my minor image manipulation needs. =)

$agif = new Imagick("animated.gif");

// Loop over all individual frames 
foreach ($agif as $frame) {

    // Do whatever you need to do here 

}

// Save the modified gif
$agif->writeImages("new_animated.gif", true);

The full set of functions available through the ImageMagick PHP extension can be found at http://php.net/manual/en/book.imagick.php

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!