1

I have tried to compress image gif or reduce size but having no success. This is my code:

string lista= "MY GIF PATH";
MagickImageCollection collection = new MagickImageCollection();
ImageOptimizer optimizer = new ImageOptimizer();
collection.Read(Lista);

for (int i = 0; i < collection.Count; i++)
{
    collection[i].ColorFuzz = (Percentage)2;
    collection[i].Depth = 8;
    collection[i].Quality = 50;
}
optimizer.LosslessCompress(Lista);
optimizer.Compress(Lista);
optimizer.OptimalCompression=true;
collection.Write(CompletePath);
collection.Dispose();

The final gif has the same or bigger size, and the depth/quality seem not to work, they look the same.

I already tried OptimizeTransparency and OptimizePlus, both increase the final size.

I am trying to do a lossy or/and lossless compress, I am open to other c# library as well.

Milo
  • 3,365
  • 9
  • 30
  • 44
greg
  • 11
  • 2

0 Answers0