GIF generation time...

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
andraspap

GIF generation time...

Post by andraspap »

I wonder if the following two examples of GIF generation times are "reasonable" or they possibly could be sped up?
I used the command:
convert Img_0.png, Img_1.png ... Img_99.png Test.gif to make a GIF animation out of 100 png files.

In the first case the png files are 55KB big (image size 1020x871), and in the second case they are 40KB big (image size: 828x585). The Bit Depth is 48 in both cases.

It took about 3 min 2 sec in the first case and 1 min 51 sec in the second case. Are these reasonable times?
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: GIF generation time...

Post by anthony »

That really depend on how much work IM had to do to reduce each image to 256 color table limits!
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
andraspap

Re: GIF generation time...

Post by andraspap »

Thank you very much for your previous answer, I was unsuccessful trying to reduce these times though by reducing the number of colors in my images. The time it takes to write the GIF file remains the same. Originally I had 4118 colors and these were reduced to 256 after the GIF file was written. I am getting these numbers from my program that writes the same images into a GIF animation that I use with the convert command. The MagickGetImageColors API gives the number of colors before and after the MagickWriteImages call. Then I reduced the colors in my images such that these numbers were:
1. 4118/256
2. 653/256
3. 213/Crash (Both convert command and my program crashes in this case).
Time spent in the MagickWriteImages call did not change (between the first two cases).

I wonder if this means that that's how much time it takes to write a GIF file? I tried some other programs like EasyGIF and Active GIF Creator. The former took about 30% more time (although including reading the images from disk) while the latter seemed way faster. These programs seem automatically reduce the number of colors and write a "worse" quality GIF (fewer colors). I wonder what would be a possible way to speed up ImageMagick when I use way fewer colors in the second case compared to the first case? Thank you for any help.
andraspap

Re: GIF generation time...

Post by andraspap »

Quantizing and not dithering the color resulted in about a 10% speed up. It is really nice to have that, please see issue: Dithering of GIF animation PostPosted: Wed Feb 13, 2008 3:20 pm
Post Reply