Using imagemagick or gifsicle to output GIF with specific filesize?

2

1

I have been following this online guide to convert a small video clip into image frames, then combine them together into a single animated GIF.

The problem I'm having is that each GIF tends to be fairly large, both in filesize and dimensions(640x480 or something similar). I have seen gifs at 640x480 that come out around ~2-3MB and that is fairly reasonable.

Most of my GIFs turn out to be way larger than 10MB, often 25-30MB total. Even sizing down smaller to 320x240 does not help very much and it's frustrating because these GIFs can't be quickly uploaded to image hosts like Imgur.

Is there a method I can use to force an output size for these GIFs? Like a command through Gifsicle that will require the final output to be ~2MB or something like this? I've gone through the online docs and I cannot find any good information about this topic. Would really appreciate any advice from people who use the CLI for this kind of image manipulation. Here's a copy of the gifsicle command from that guide:

gifsicle -O3 --colors 256 Almost.gif > Done.gif

Jake

Posted 2013-11-30T12:42:14.943

Reputation: 121

If imagemagick is not a requirement, perhaps you can see this: http://superuser.com/questions/438939/is-there-a-tool-that-allows-me-to-edit-a-picture-so-that-it-has-an-exact-file-si/905585#905585

– George – 2015-04-24T10:22:14.037

No answers