Command line parameters

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
theboywonder
Posts: 2
Joined: 2015-12-01T03:50:54-07:00
Authentication code: 1151

Command line parameters

Post by theboywonder »

Hi
I need a process to convert TIF images to two different JPG formats, each in there own subfolder. I am suspecting this will be two separate command line tasks?

I'd be grateful if anyone can offer some guidance. I have read the Command Line usage guide, but I am not familiar with command line usage.

Source: TIFF, in folder c:\TIFFs\
Destination 1: JPG, 72dpi, width no more than 1148px, save in folder 'c:\tiffs\JPG1\'
Destination 1: JPG, 72dpi, width no more than 150px, save in folder 'c:\tiffs\JPG2\'

Filename to remain the same.

Any help is appreciated.
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Command line parameters

Post by Bonzo »

I would try this BUT I am not sure how to keep the filename the same.

Code: Select all

input.jpg ( -clone 0 -thumbnail 1148px -write "c:\tiffs\JPG1\output.jpg" +delete ) -thumbnail 150x "c:\tiffs\JPG2\output.jpg" null:
theboywonder
Posts: 2
Joined: 2015-12-01T03:50:54-07:00
Authentication code: 1151

Re: Command line parameters

Post by theboywonder »

This is what I have so far, but I need the output to be in a subfolder...

Code: Select all

convert *.TIF -units PixelsPerInch -resize 1148 -density 72 -set filename:out %t %[filename:out].jpg
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Command line parameters

Post by fmw42 »

You will need to write a script loop over each input TIFF and use bonzo's solution with your -set filename. Put the -set filename just after reading the input and before the parenthesis.
Post Reply