merge several thousand images with arrayjoin #3755
Replies: 7 comments
-
You can do it with a
But (at least with 10,000 jpgs) it'll fail with argument list too long. I think you'll need to use something like python. |
Beta Was this translation helpful? Give feedback.
-
Thank you John but then I will also fail with your proposal. I have 97 x 88 (8536) files to handle with. Is there any way of chunking?
|
Beta Was this translation helpful? Give feedback.
-
Sure, you can assemble in sections. I would use tiled jpeg TIFF for the intermediates. Of course, it'll be slower and you'll need a lot of disc space. Is python / C# / ruby / php / etc. not possible? |
Beta Was this translation helpful? Give feedback.
-
... I tried some other sizes. 70x70 (5,000) jpgs failed with arg list too long, but 50x50 (2,500 jpgs) worked fine. So the limit is somewhere in that range. |
Beta Was this translation helpful? Give feedback.
-
Thanks John for testing it. |
Beta Was this translation helpful? Give feedback.
-
There's no built in way of doing that, no. I'd either assemble in sections, or use python. In python, it'd be: import sys
import glob
import pyvips
input_directory = sys.argv[1]
output_file = sys.argv[2]
tiles_across = int(sys.argv[3])
images = [pyvips.Image.new_from_file(filename, access="sequential")
for filename in glob.glob(f"{input_directory}/*.jpg")]
joined = pyvips.Image.arrayjoin(images, across=tiles_across)
joined.write_to_file(output_file) |
Beta Was this translation helpful? Give feedback.
-
Thank you! |
Beta Was this translation helpful? Give feedback.
-
Hi,
how is it possible in Windows to join several thousand images with arrayjoin method?
Writing all filenames to cammand line at once is not possible
this is working limited to a few files only
vips arrayjoin "00.jpg 01.jpg 02.jpg 03.jpg" x.jpg --across=2
this is not working but needed for several thousand files
vips arrayjoin "*.jpg" x.jpg --across=2
Any ideas how to handle that maybe with a for loop?
Thank You
Beta Was this translation helpful? Give feedback.
All reactions