Page 1 of 1

converting multiple files in single command

Posted: 2009-07-04T10:58:56-07:00
by Pravin
Hi,

I have to convert multiple files in a single command (convert.exe)
e.g.
I have two jpeg file
1.jpeg
2.jpeg

I have to convert 1.jpeg to 1_new.jpeg with options
and 2.jpeg into 2_new.jpeg with format options.

How I can use convert command to perform above operation.
Is it possible with "convert" command to perform this operation?

I have tried like

convert 1.jpeg -resize 100X200 1_new.jpeg 2.jpeg -resize 200X300 2_new.jpeg.
But this does not work.

Please help me out..

Thanks.

Re: converting multiple files in single command

Posted: 2009-07-04T11:22:40-07:00
by fmw42
You have to use parenthesis to process each image and -write to write it out.

convert \( image1 ... -write image1_new +delete \) \( image2 ... -write image2_new +delete \) null:

see parenthesis processing, delete and write at:
http://www.imagemagick.org/Usage/basics/#image_seq
http://www.imagemagick.org/Usage/files/#write_seq

Note: on windows \( becomes just (

see
http://www.imagemagick.org/Usage/windows/

Re: converting multiple files in single command

Posted: 2009-07-06T06:41:20-07:00
by Pravin
Thanks a lot !!! Its working. :D