converting multiple files in single command

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
Pravin

converting multiple files in single command

Post 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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: converting multiple files in single command

Post 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/
Pravin

Re: converting multiple files in single command

Post by Pravin »

Thanks a lot !!! Its working. :D
Post Reply