How to reduce gif size in batch process

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
agriz
Posts: 232
Joined: 2011-10-01T02:21:30-07:00
Authentication code: 8675308

How to reduce gif size in batch process

Post by agriz » 2017-10-29T04:16:47-07:00

Code: Select all

convert raw/1.gif -fuzz 10% -layers Optimize processed/1.gif
This command reduces the gif size.
But how can i do batch process?
Right now, i have to do one by one in command promt

Thanks

snibgo
Posts: 9380
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: How to reduce gif size in batch process

Post by snibgo » 2017-10-29T05:30:02-07:00

Put it in a shell loop.
snibgo's IM pages: im.snibgo.com

agriz
Posts: 232
Joined: 2011-10-01T02:21:30-07:00
Authentication code: 8675308

Re: How to reduce gif size in batch process

Post by agriz » 2017-10-29T06:36:10-07:00

Images name are different. They are not just 1.gif 2.gif

snibgo
Posts: 9380
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: How to reduce gif size in batch process

Post by snibgo » 2017-10-29T07:12:22-07:00

So? You can loop through all the files in a directory. Or all the files named "*.gif" or "?.gif" or whatever you want.
snibgo's IM pages: im.snibgo.com

agriz
Posts: 232
Joined: 2011-10-01T02:21:30-07:00
Authentication code: 8675308

Re: How to reduce gif size in batch process

Post by agriz » 2017-10-30T21:55:23-07:00

Code: Select all

mogrify -fuzz 10% -layers Optimize raw/*.gif  processed/*.gif
This one works. But makes changes in raw folder itself
I dont know what to loop

User avatar
fmw42
Posts: 22083
Joined: 2007-07-02T17:14:51-07:00
Location: Sunnyvale, California, USA

Re: How to reduce gif size in batch process

Post by fmw42 » 2017-10-31T09:09:11-07:00

You can use the -path option in mogrify to send the files to another (empty if desired) folder, which must exist already. See http://www.imagemagick.org/Usage/basics/#mogrify

agriz
Posts: 232
Joined: 2011-10-01T02:21:30-07:00
Authentication code: 8675308

Re: How to reduce gif size in batch process

Post by agriz » 2017-10-31T23:41:06-07:00

fmw42 wrote:
2017-10-31T09:09:11-07:00
You can use the -path option in mogrify to send the files to another (empty if desired) folder, which must exist already. See http://www.imagemagick.org/Usage/basics/#mogrify
Thank you so much! It works now as i expected

Post Reply