简体   繁体   English

用Imagick PHP调整动画GIF图像大小

[英]Animated GIF Image Resize with Imagick PHP

I wants to resize animated GIF images without loosing animation. 我想调整动画GIF图像的大小而不丢失动画。 Resize process is working fine but after resize animation goes away. 调整大小过程工作正常,但是调整大小后动画消失了。 Please check my script in-line if i am doing anything wrong 如果我做错任何事情,请在线检查我的脚本

Version: ImageMagick 6.9.1-1 PECL Imagick Extension - 3.1.2 版本:ImageMagick 6.9.1-1 PECL Imagick Extension-3.1.2

$images = $this->imageObj->coalesceImages();
foreach ($images as $frame) {
 $frame->thumbnailImage($this->thumbWidth, $this->thumbHeight);
 $frame->setImagePage($this->thumbWidth, $this->thumbHeight, 0, 0);
}

$this->imageObj = $images->deconstructImages();
$this->imageObj->writeImage($this->thumbImagePath);

See this answer . 看到这个答案 From the link: 从链接:

If you have imagemagick access, you can do this: 如果您具有imagemagick访问权限,则可以执行以下操作:

 system("convert big.gif -coalesce coalesce.gif"); system("convert -size 200x100 coalesce.gif -resize 200x10 small.gif"); 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM