1

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

WendiKidd
  • 4,333
  • 4
  • 33
  • 50
  • Okay, I guess you are able to load the jpeg images, right? So the only problem would be to arrange the frames after each other (multi-page image) and save as gif. IIRC this is possible with Imagemagick so I guess it's possible as well with Graphicsmagick. Which of the many functions have you looked into so far? – hakre Jun 23 '12 at 14:10
  • Yeah. how can i load jpg files as frames, add as frame and duration also create infinite loop or loop time and standard creation GIF format using PHP script and Gmagick extension. – Mohammad Hossein Fattahizadeh Jun 23 '12 at 14:13

3 Answers3

1

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!

hakre
  • 193,403
  • 52
  • 435
  • 836
1

alone with run the next command be can do

open the terminal of command in linux and write it

convert -delay 25 1.png  2.png 3.png 4.png 5.png 6.png 7.png 8.png 9.png 10.png -loop 0 animate.gif

you can to create the image with inkscape and export to .png .jpg or other format

Leonardo Pineda
  • 990
  • 8
  • 10
0

Please Try..

Creating an Animated GIF image

ImageMagick v6 Animation basics

Bhavin Rana
  • 1,554
  • 4
  • 20
  • 40