0

Let's say I have many jpg files which all have this format: X-Y.jpg while X and Y are numbers from 0 to 99 and also define the location of themselves in the final image.

Now I've tried this command to create one image out of those many tiles.

montage.exe -tile 99x99 @D:\img\list.txt D:\output\out.jpg

But it expands my image file list not correctly.

montage.exe: unable to open image '@D:D:\input\0-59.jpg': Invalid argument @ error/blob.c/OpenBlob/3489.

Here is a reference for the imagemagick manual, where it says for large numbers of files you can read a list of input files from a specific file by "@in.txt": http://www.imagemagick.org/script/command-line-processing.php#input

pfx
  • 20,323
  • 43
  • 37
  • 57
Peter
  • 394
  • 7
  • 20
  • 1
    Have you tried putting quotes about `@D:\img\list.txt`? I am not sure that you can use volumes in the @ syntax. See also similar issue at https://stackoverflow.com/questions/51936992/powershell-with-image-magick-montage-reading-from-text-file/51955571#51955571 for Mark Setchell's suggestion: `TYPE E:\Output\contactSheetImages.txt | montage ... @- result.jpg` – fmw42 Aug 25 '18 at 15:24
  • You can't fit 10,000 images (100x100) into a grid of 9,801 (99x99) locations. – Mark Setchell Aug 25 '18 at 16:13
  • @fmw42 Yes I've tried quotes but it doesn't change anything. And the suggestion of `TYPE file | montage ... @- out.jpg` did work but the input stops after around 86000 chars. Maybe there is a limit for passing chars? @Mark Setchell I also tried `tile 100x100` which doesn't help, the error stays the same. – Peter Aug 25 '18 at 17:41
  • 1
    I am not a Windows user, but Windows may have a limit on characters. You may be running out of RAM or other limitations such as limited width or height for which you may be able to fix by editing your ImageMagick policy.xml file. You can see your basic resources from `convert -list resource` and your policy from `convert -list policy`. Otherwise find your policy.xml file and edit it appropriately. See https://www.imagemagick.org/script/resources.php. What is your Imagemagick version and how much memory to you have. `convert -version` – fmw42 Aug 25 '18 at 17:48
  • 1
    If you rename your files so that they list alphabetically in your D:\img directory in the order you need to tile them, then you could try: `montage.exe -tile 99x99 D:\img\* D:\output\out.jpg` or change directories to D:\img. Then do `C:path\to\montage.exe -tile 99x99 * \output\out.jpg`. – fmw42 Aug 25 '18 at 17:58
  • @fmw42 `resource` -> I don't see any limits that could limit my file count `policy` -> undefined. And wildcards don't work in windows (asterisk *) . – Peter Aug 26 '18 at 08:00
  • 1
    Might you have a bad file? Try processing starting around where it left off before? Does that work? – fmw42 Aug 26 '18 at 17:20
  • @fmw42 The montage worked when I did this: 63*1 tiles and then 1*63 tiles.That were 64 commands and I did it with %d param in the file name. But it is not a solution for this question, as I would like to have one single command. But it shows that there is no bad file. – Peter Aug 26 '18 at 18:21
  • Really sounds like a character limitation in some way or memory/disk limitation. Do you have enough memory to hold all the input images and the output at the same time? If the files are compressed, then you must account for their size after compression when doing the computation. How big are your input file dimensions and what is the format? What do you get from `convert.exe -list resource`. Seems to be a similar issue here https://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=34634 – fmw42 Aug 26 '18 at 18:30
  • See the output of `convert -list resource` here: https://pastebin.com/raw/v4vWkDAd – Peter Aug 30 '18 at 15:41

1 Answers1

1
  1. Put the filenames in the list.txt without any prepending directory.
  2. Put the list.txt file into the folder where all tiles are located
  3. Open cmd and change to the directory with all the tiles and the list.txt
  4. montage -tile 63x63 @list.txt out.jpg

Thanks to the user snibgo from https://www.imagemagick.org/discourse-server who helped me with a hint.

Peter
  • 394
  • 7
  • 20