Memory spike while coalesce and write operation happens on multi frame GIF #1039
Replies: 2 comments 2 replies
-
The large memory footprint is happening because of the way the A possible solution would be to only resize and crop the images and adjust the p.s. I don't understand why you do both a |
Beta Was this translation helpful? Give feedback.
-
Hi @dlemstra, One small question, to fetch the frame count for gifs using Magick.NET, is there any built-in method or the only approach is -
? |
Beta Was this translation helpful? Give feedback.
-
Hi @dlemstra & Team,
I have been trying to resize my multi-frame (415) gif and my code runs in a docker environment with a Memory restriction of 512 MB.

However, I noticed that the memory spikes to 920 MB+ while using Magick.NET-Q16-AnyCPU library to resize to 100 * 100.
Based on some articles that I came across, I changed it to Magick.NET-Q8-AnyCPU and it spikes to 520 MB+.
This works in a normal console application but when I include it in my container-based service, it crashes.
Also, if I resize it to say 400 * 400, it increases the size of the saved file which is not desirable.
Attached is the reference gif that I used.
The calculation segment I had to refer from here- https://stackoverflow.com/questions/10337800/resize-with-crop-using-imagemagick-net-and-c-sharp
I am struggling to optimize this to consume as little memory as possible together with a fast response time else it gives timeout.
Code snippet:
Beta Was this translation helpful? Give feedback.
All reactions