Resize animated gif to certain filesize

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
Marcel71
Posts: 49
Joined: 2011-04-13T13:57:34-07:00
Authentication code: 8675308

Resize animated gif to certain filesize

Post by Marcel71 »

Hi All,

I found that you can resize a jpg file to a maximum file size by:

Code: Select all

convert image -define jpeg:extent=512kb newimage.jpg
Is there also such a function for animated gifs?
Marcel71
Posts: 49
Joined: 2011-04-13T13:57:34-07:00
Authentication code: 8675308

Re: Resize animated gif to certain filesize

Post by Marcel71 »

Okay, after some research (and looked at Fred's scripts) i see it can only be done with trial and error. :(
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Resize animated gif to certain filesize

Post by snibgo »

JPEG files have a trade-off between image quality and file size. For animation, some formats (such as MPG) also have this trade-off. GIF does not.
snibgo's IM pages: im.snibgo.com
Post Reply