does it realy take this long to create an animated gif?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
bbunlock
Posts: 8
Joined: 2006-06-04T08:39:46-07:00
Location: England

does it realy take this long to create an animated gif?

Post by bbunlock »

I have just wrote a php script for my site (with the help of great members on here) and the last thing the script does is create an animated gif from 3 jpg images

the 3 jpg images are only 176x235 and avarege around 35kb each, however when I create an animated gif from them it takes around 5 to 7 seconds (on a duel zeon server), so as the title of this topic says "does it realy take this long to create an animated gif?"

I will paste the code im using for the animated gifs below, however if 5 to 7 seconds is average to create an animated gif from 3 jpg's of that size then at least I know im not doing anything wrong, It just that 5 to 7 seconds seem a long time for this?

Code: Select all

		$crop_image = $imageMagickPath."convert -delay 150 -dispose None "
                ." -page 176x235+0+0  screen1.gif  "
               ."  -page +0+0 screen2.jpg  "
                ." -page +0+0 screen3.jpg  "
		." -loop 0 theme.gif";
		
			exec($crop_image);
the screen1.jpg, screen2.jpg, screen3.jpg are all 176x235 and its just a simple animation looing through those 3 images.

am I doing this right?

regards
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: does it realy take this long to create an animated gif?

Post by fmw42 »

I don't know if this relates to your problem directly, but see

viewtopic.php?f=3&t=11413
bbunlock
Posts: 8
Joined: 2006-06-04T08:39:46-07:00
Location: England

Re: does it realy take this long to create an animated gif?

Post by bbunlock »

thanks for the quick reply fmw42

I am not sure if that applies to me or not? it may do as im actualy using an older version "ImageMagick 6.2.8"

but it would apear to be no pooint updating yet until they have repleased the patch for that (today i think gonna check it out)

anain thanks for the heads up on that, will let you know how I get on.

UPDATE

I have just done a convert of a jpg to a gif (not animated) and it took about a second to do it, so im guessing thats not my problem.

regards
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: does it realy take this long to create an animated gif?

Post by anthony »

More than likely the time is involved with color quantization and dithering, which is required to compress PNG and JPEG images containing 'millions' of colors to GIF which only allows 256 colors maximum per frame. The larger the image the harder it is to create a GIF.

You may like to look at some of the techniques looked at quickly in the IM Examples page on 'Videos' EG video to GIF conversion.
http://imagemagick.org/Usage/video/

This is looked at in even more detail on animation optimization.
http://imagemagick.org/Usage/anim_opt/

Basically GIF is only a good format when you deal with small images of uniform, and minimal colors. JPEG will make this worse as it's lossy behaviour causes simple images to suddenly contain LOTS of slight color variations. Don't use it for intermediate images if you can.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply