spend too much time on merge gif

Magick.NET is an object-oriented C# interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick.NET
Post Reply
jinonline
Posts: 4
Joined: 2015-12-17T08:57:15-07:00
Authentication code: 1151

spend too much time on merge gif

Post by jinonline »

Hi.
sorry, My English is pretty limited, please don't mind

in my case, I need to merge some picture to gif, Each picture about 120kb or more
my code sample:

Code: Select all

string[] photos = Directory.GetFiles(path, "*.jpg");
using (MagickImageCollection collection = new MagickImageCollection())
{
  int iarray = 0;
  foreach (string name in photos)
    {
      collection.Add(name);
      collection[iarray].AnimationDelay = 0;
      iarray++;
    }

    QuantizeSettings settings = new QuantizeSettings();
    settings.Colors = 256;
    collection.Quantize(settings);

    collection.Optimize();
    collection.Write("imagemagick.gif");
}
20 photos in directory, total file size about 3mb
when i start project, it need spend 1min and imagemagick.gif file size 8.xmb

Q1, is it normal?? 1min too long ...
Q2, why file become to bigger? (3mb=>8mb)

Thank you
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: spend too much time on merge gif

Post by dlemstra »

The size of the file does not really matter. What are the dimensions (width/height) of your input images?
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
jinonline
Posts: 4
Joined: 2015-12-17T08:57:15-07:00
Authentication code: 1151

Re: spend too much time on merge gif

Post by jinonline »

dlemstra wrote:The size of the file does not really matter. What are the dimensions (width/height) of your input images?
hi
image dimensions is 700x700
when i remove these code
--------
QuantizeSettings settings = new QuantizeSettings();
settings.Colors = 256;
collection.Quantize(settings);
---------
Speed will become faster 20~30%~
but file size still too big~
Post Reply