I got a simple website that has a GIF image from an external source but the GIF animation is too slow so I want to know how I can change the GIF animation speed using PHP GD. I will be setting it to a fixed speed so I won't need to worry about having variable speeds.
Asked
Active
Viewed 273 times
-1
-
1No you can't. From [GD's documentation](http://php.net/manual/en/function.imagecreatefromgif.php), *When reading animated GIF files into memory, only the first frame is returned in the image resource pointer.* – Raptor Jul 20 '17 at 02:04
-
Well since I'm using 7.1, is there a way to increase the animation speed in php? – Red Dragon Jul 24 '17 at 23:48
-
Still can't . PHP GD library has no such feature. – Raptor Jul 25 '17 at 02:48
1 Answers
0
Well I got it to work by using these two classes.
https://www.phpclasses.org/package/3234-PHP-Split-GIF-animations-into-multiple-images.html https://www.phpclasses.org/package/3163-PHP-Generate-GIF-animations-from-a-set-of-GIF-images.html
This works by decoding the GIF into separate images and then recombining them into a new GIF at a different animation speed. I'm not sure if this uses GD but it does what I needed it to do without using imagick.

Red Dragon
- 43
- 6