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?".
Locked
agriz
Posts: 237
Joined: 2011-10-01T02:21:30-07:00
Authentication code: 8675308

How to reduce gif size in batch process

Post by agriz »

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: 13034
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 »

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

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

Re: How to reduce gif size in batch process

Post by agriz »

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

snibgo
Posts: 13034
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 »

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

Re: How to reduce gif size in batch process

Post by agriz »

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: 26383
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How to reduce gif size in batch process

Post by fmw42 »

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

Re: How to reduce gif size in batch process

Post by agriz »

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

Locked