does -append option allow a file list?

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
zomp

does -append option allow a file list?

Post by zomp »

I need to use convert -append specifing a very long list of files (more than one hundred). Is it possible to pass such list to the convert command as a file?
For example, somewhat similar to the following line:

Code: Select all

convert -append list.txt result.png
where list.txt contains the following lines:

Code: Select all

file1.png
file2.png
file3.png
...
file101.png
file102.png
file103.png
...
Thanks for your wonderful program.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: does -append option allow a file list?

Post by magick »

Try this command:
  • convert -append 'file*.png' result.png
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: does -append option allow a file list?

Post by anthony »

Note that the above is a 'legacy' method, See IM Examples Basics
http://imagemagick.org/Usage/basics/#legacy

Actually to do it correctly, read the images in, before appending.

Code: Select all

  convert image*.png -append result.png
Under a UNIX shell you can read arguments from a file using a backquote string substitution technique...

Code: Select all

convert `cat list.txt` -append result.png
Please note that ALL these methods will read in all the images into memory before creating a new image. That means it will require just under 2 times the memory needed for all the input images.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
zomp

Re: does -append option allow a file list?

Post by zomp »

magick wrote:Try this command:
  • convert -append 'file*.png' result.png
Yes, I have already tried this solution. But for some unexpected reason, the images are not read in order*, so that in result image I find, for example, file99.png before image1.png. I need the list file just to override the order the images are passed to convert command.

* or they are ordered, but I can not control the order they are written into the folder directory.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: does -append option allow a file list?

Post by magick »

Try this command:
  • convert 'file?.png' 'file??.png' 'file???.png' -append result.png
Post Reply