c# - Setting options to images in Magick .NET collection -


I'm trying to reduce the file size of GIF animation, I've read how to do it . Another thread has suggested to reduce the quality, add compression and make the photo a little blurred, which I am trying to do:

 using  (MagickImageCollection col = New MagickImageCollection (@ "C: / PathToGif")) {for (int i = 0; i & lt; col.Qount; i ++) {Cole [i] .Quality = 85; Colonel [I] Compression Method = Compression Method LZW; Col [i] .Strip (); } Col.Write (@ "C: / path / to / outpath"); }   

Although the code is running but setting can not be ignored, while setting AnimationDelay works the same way. I confirm this by checking the quality of the output and the file size, it seems that when I do not use any settings, even setting quality to 20, Find similar results.

I also tried to use QuantizeSettings , where I crossed the value of 255 in the color property . That was to lock my application while using 50% of the CPU. (I gave the application about 5 minutes before closing firmly)

My application is about one in 950 kb. GIF processes and changes it to 5.3 MB, which is unacceptable. (Disclaimer: I add approximately 20 + - frame to GIF and drag an overlay on it).

There may be some experience with Magic. The Net Library tells me whether I am doing something wrong and tell me in the right direction to do this? I was unable to find another way to implement these settings.

GIF codeer does not use quality settings and compression method always compression method. LZW will be. If you want to customize the output file, then you should do the following:

 using  (MagickImageCollectioncol = New MagickImageCollection (@ "C: / PathToGif")) {col.Coalesce (); AddOtherImages (col); Col.Optimize (); Col.OptimizeTransparency (); Col.Write (@ "C: / path / to / output"); }   

Make sure you upgrade to the latest version, optimized / optimized transparency methods were past in previous versions.

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -