I have pair of images in the folder:
221013.bmp
221013.png
221018.bmp
221018.png
221020.bmp
221020.png
I'm trying to merge every pair of images in a folder and combine that result into a JPG file with imagemagick
magick convert C:\Img\*.bmp -set filename:f "%t" "C:\Img\%[filename:f].png" -composite "C:\Img\%[filename:f].jpg"
One JPG with correct name is created and error:
convert: unable to open image 'C:\Img%[filename:f].png': No such file or directory @ error/blob.c/OpenBlob/3537.
Any idea?, thank you.
If your system memory can hold all the BMP and PNG images, and if every BMP image has a PNG to match, a command like this will read in all the BMPs, set the output filenames, add an ImageMagick special image called "null:" to separate the two sets of images, then read in the PNGs. The "-layers composite" operation takes each image from before the "null:", composites it with its companion image from after the "null:", and outputs the results with the filenames of the input BMPs.
magick *.bmp -set filename:f "%[t]" null: *.png -layers composite "%[filename:f].jpg"
This requires you run the command in the folder containing the images.
Edited to add: Unless you need the behavior of ImageMagick v6, you should omit "convert" from the command and just use "magick" to get IMv7 behavior.