Batch combine pairs of images

XnConvert Multi Platform - Windows, MacOSX, Linux

Moderators: XnTriq, helmut, xnview

cmwkings33
Posts: 1
Joined: Thu Sep 09, 2021 7:07 pm

Batch combine pairs of images

Post by cmwkings33 »

Hello All and hope everything is well.

I hope I'm posting this in the right forum so here goes. I would like to combine two images size by size from a specified folder or a list of files. Is this possible? I can't seem to find the command to do this.

An example would be having a folder with say 40 images each having corresponding filenames with a different number sequence. Is there a way to multi-select them all and how the program output 20 files with the 40 images combined separately into 20 images, or even have the options of combining 4 images in one file?

Another way of saying this would be batch merging images side by side. Thanks in advance for any assistance and sorry if this has been asked and answered previously.
cday
XnThusiast
Posts: 4178
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Batch Image Combining

Post by cday »

cmwkings33 wrote: Thu Sep 09, 2021 7:16 pm I would like to combine two images side by side from a specified folder or a list of files. Is this possible? I can't seem to find a command to do this.

An example would be having a folder with say 40 images each having corresponding filenames with a different number sequence. Is there a way to multi-select them all and how the program output 20 files with the 40 images combined separately into 20 images, or even have the options of combining 4 images in one file?

Another way of saying this would be batch merging images side by side. Thanks in advance for any assistance and sorry if this has been asked and answered previously.
There is no support for that in XnConvert as far as I know, however XnView MP in the file browser has Create > Join images... which provides that function, although only for pairs of images at a time.

If the command line utility NConvert supports the function, I'm not sure that it currently does, and you have experience of creating batch files, automated processing of a folder of images might well be possible with some fairly basic coding.

If NConvert doesn't currently support the function, which I think is likely, there could be a possible workaround using the canvas resize and watermark functions. If the files are numbered in a suitable sequence it might not be too difficult.
Scargoth
Posts: 24
Joined: Wed Jan 17, 2018 12:23 pm

Re: Batch combine pairs of images

Post by Scargoth »

Bonjour,
J'aimerais (moi aussi) pouvoir combiner des dalles d'images directement avec XnView.
Les ensemble de tuiles ont généralement un nom du type N°colonne_N°ligne à partir de "0_0", ce qui donne par exemple "11_6.jpg" pour la tuile de la 12ème colonne - 70ème ligne...
Actuellement je suis "obligé" de récupérer la liste des fichiers grâce à "Créer / Liste des fichiers (Ctrl+L) /Copier dans le presse-papier.
et de les coller dans une feuille Excel.
j'extrais les noms de ligne et colonne pour les trier par ligne puis colonne, et trouver le nombre de Lignes et nombre de colonnes.

à partir de ceci, je crée une commande de type magick montage -mode concatenate -tile nbLignesXnbColonnes liste_d'images "Nom de l(image fusionnée.jpg"
par exemple pour créer l'image nommée Paul Ochon (1945-1999), Bataille d'oreillers, France, 1974.jpg à partir d'un ensemble de tuiles en 5 colonnes de 4 tuiles :
magick montage -mode concatenate -tile 5x4 0_0.jpg 1_0.jpg 2_0.jpg 3_0.jpg 4_0.jpg 0_1.jpg 1_1.jpg 2_1.jpg 3_1.jpg 4_1.jpg 0_2.jpg 1_2.jpg 2_2.jpg 3_2.jpg 4_2.jpg 0_3.jpg 1_3.jpg 2_3.jpg 3_3.jpg 4_3.jpg "Paul Ochon (1945-1999), Bataille d'oreillers, France, 1974.jpg"
que j'exécute ensuite dans une fenêtre de commande "DOS"...
L'outil magick est disponible, ainsi que la documentation des instructions de commandes en ligne ici : https://imagemagick.org/script/convert.php

J'avoue que pouvoir le faire directement à partit de XnView, et même pour des images ayant des noms structurés différemment (sans être obligé de rebidouiller mes formules dans Ecxel ^^) serait un pur bonheur.

(Cerise sur le gâteau : Parfois, au lieu de renommer à la main les dalles, (quand il n'y a pas de logique de nom), le faire à partir d'un tri manuel dans XnView (comme un puzzle) serait pratique... )


-------------------------------------------------
Hello,
I (too) would like to be able to combine image tiles directly with XnView.
Tile sets usually have a name of the type N°colonne_N°ligne starting from "0_0", which gives for example "11_6.jpg" for the tile of the 12th column - 70th line...
Currently I am "obliged" to recover the list of files thanks to "Create / List of files (Ctrl+L) / Copy to clipboard.
and to paste them in an Excel sheet.
I extract the row and column names to sort them by row and column, and find the number of rows and number of columns.

from this, I create a command like magick montage -mode concatenate -tile nbRowsXnbColumns image_list "Name of merged image.jpg"
for example to create the image named Paul Ochon (1945-1999), Bataille d'oreillers, France, 1974.jpg from a set of tiles in 5 columns of 4 tiles:
magick montage -mode concatenate -tile 5x4 0_0.jpg 1_0.jpg 2_0.jpg 3_0.jpg 4_0.jpg 0_1.jpg 1_1.jpg 2_1.jpg 3_1.jpg 4_1.jpg 0_2.jpg 1_2. jpg 2_2.jpg 3_2.jpg 4_2.jpg 0_3.jpg 1_3.jpg 2_3.jpg 3_3.jpg 4_3.jpg "Paul Ochon (1945-1999), Bataille d'oreillers, France, 1974.jpg"
which I then execute in a "DOS" command window...
The magick tool is available, as well as the documentation of the command instructions online here : https://imagemagick.org/script/convert.php

I must admit that being able to do it directly from XnView, and even for images with different structured names (without having to rewrite my formulas in Ecxel ^^) would be a pure joy.

(Icing on the cake: Sometimes, instead of renaming tiles by hand, (when there is no name logic), doing it from a manual sorting in XnView (like a puzzle) would be convenient... )

Translated with www.DeepL.com/Translator (free version)
User avatar
helmut
Posts: 8705
Joined: Sun Oct 12, 2003 6:47 pm
Location: Frankfurt, Germany

Re: Batch combine pairs of images

Post by helmut »

+1 Thank you for your good suggesion which I support, Scargoth.
It would be really cool if batch conversion would have functions that can handle multiple images. This could be for joining images, or overlay several images, or... Base could be parameters (nconvert) or a list of file. And combination could be done by order of the files (as described in your example).
User avatar
budz45
XnThusiast
Posts: 1621
Joined: Sun Jun 03, 2007 6:05 pm
Location: UK

Re: Batch combine pairs of images

Post by budz45 »

I fully support this :D :D :D

It would need proper testing and feedback as a beta. I'm confident it would work.

I had the idea of naming this feature as 'Stacks', see this topic here: viewtopic.php?f=60&t=43932&p=180691#p180691

Below I have just created this mock up image to illustrate how it could look like in the "join Images" window. Notice how I created another tab called 'Stacks' an I used some UI elements from XnConvert's 'Actions' feature... :D
Stacks feature in Join Images.png
When you expand each stack, it would give you a thumbnail preview of the image for which you can re-arrange the order just like in File list.
You do not have the required permissions to view the files attached to this post.
All My Topics || my 'MP' Topics
My own Bookmarked topics--->for me only