Page 1 of 1

Very long command line

Posted: 2007-10-12T12:41:58-07:00
by mzorova
Is there any way to use convert and ask it to take all the parameters from a file? I have a 100 files that I would like to append (in a specified order) to one another to create a very large image, and then crop and resize the result, etc.

Or is the only way to do it to split it up into multiple convert commands?

Re: Very long command line

Posted: 2007-10-12T12:53:36-07:00
by magick
Some of convert's options can be placed in a file and you can also use wildcards to shorten the command line length. You could say, for example,
  • convert "*.jpg" image.png
You need the quotes so the shell does not interpret the wildcard character, instead ImageMagick interprets it.

Re: Very long command line

Posted: 2007-10-12T18:16:48-07:00
by mzorova
Since the order is important the globbing will not work unfortunately. Outside of draw parameters is there anything else that can be in a file? If yes, where can I find the list of the ones that are?

Re: Very long command line

Posted: 2007-10-16T17:51:20-07:00
by anthony
You can also pipeline the output of separate commands into one IM.

For example

Code: Select all

   for ...loop thru files in order wanted....
       convert image ...options... miff:-
   done |  montage miff:- ...montage_options... image_page%02d.png
The convert commands can do what ever individual image process you need, in the image order you need. The loop output will be a stream of images, one after the other that a single command will read as a single image sequence.

You can even do your montage labeling in the convert command, rather than a global label in the montage.

It is one of the lesser used features of the Magick Image File Format (MIFF). I have used it in scripts to process a recursive directorys of images.

WARNING: the convert should also do the montage size reduction (thumbnailing) to reduce the size of the images being passed to montage (or whatever further processing you are doing).