Imagick takes long time to resize GIFs with lot of frames

IMagick is a native PHP extension to create and modify images using the ImageMagick API. ImageMagick Studio LLC did not write nor does it maintain the IMagick extension, however, IMagick users are welcome to discuss the extension here.
Post Reply
DiFdo
Posts: 3
Joined: 2018-01-16T10:50:04-07:00
Authentication code: 1152

Imagick takes long time to resize GIFs with lot of frames

Post by DiFdo »

Im getting issues with some GIF images which has over 300 -400 frames when getting resized it takes longer time. Is there any way to optimizing this ?
Imagick PHP extension. pls advice
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Imagick takes long time to resize GIFs with lot of frames

Post by snibgo »

Of optimizing what? How can we optimize your command if you don't tell us what it is?

Hint: "-resample" or "-scale" will be faster than "-resize". A specialist GIF processer such as gifsicle may be quicker than IM.
snibgo's IM pages: im.snibgo.com
DiFdo
Posts: 3
Joined: 2018-01-16T10:50:04-07:00
Authentication code: 1152

Re: Imagick takes long time to resize GIFs with lot of frames

Post by DiFdo »

@snibgo

Im using PHP aPI , below is my current code

$imagick->coalesceImages();

foreach ($imagick as $frame) {
$frame->thumbnailImage($width, $height);
$frame->setImagePage($width, $height, 0, 0);
}

$imagick = $imagick->deconstructImages();
$imagick->writeImages($filePath, true);
Post Reply