[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: using convert to batch convert



Aaron Brashears wrote:

> I have many, many images that I want to scale down using imagemagick's
> convert utility. The convert utility doesn't seem to work correctly
> unless you give it an output name per input filename, but the man page
> doesn't make it clear how to do this, and I'm stumped as to how to
> generate a new name for each input file name.
> 
> The command I would expect to work:
> 
> convert -sample 50% *

If you _don't_ want to keep the original

In tcsh:

 foreach F (*)
  mogrify -sample 50% $F
 end

If you _do_ want to keep the oroginals, create a directory to
store the smaller version:

 mkdir small
 foreach F (*)
  convert -sample 50% $F small/$F
 end

If you'd want to convert from gif to jpg, you'd do:

 foreach F (*.gif)
  convert $F $F:r.jpg
 end

Peter



Reply to: