Concatenate images ---------------------------------------------------------------------------------------------------- #Using ImageMagick "C:\Program Files\ImageMagick-7.1.0-Q16-HDRI"\magick convert -adjoin image1.jpg image2.jpg -gravity center -append image_concat.jpg #Ref: https://imagemagick.org/script/command-line-options.php#adjoin ---------------------------------------------------------------------------------------------------- #Using Python #Install Python from https://www.python.org/downloads/ (note: if on Windows 7, can only install Python 3.8.10 or lower) #C:\Python\Python38\Scripts\pip install Pillow or C:\Python\Python38\Scripts\python -m pip install Pillow #Put image1.jpg and image2.jpg in the same folder as the following Python script. Run python command against the Python script. C:\Python\Python38\python from PIL import Image im1=Image.open('image1.jpg') im2=Image.open('image2.jpg') def get_concat_v(im1, im2): dst = Image.new('RGB', (im1.width, im1.height + im2.height)) dst.paste(im1, (0, 0)) dst.paste(im2, (0, im1.height)) return dst get_concat_v(im1, im2).save('result.jpg') #Ref: https://note.nkmk.me/en/python-pillow-concat-images/ ---------------------------------------------------------------------------------------------------- #Another Python program from PIL import Image import sys images = [Image.open(x) for x in ['image1.jpg', 'image2.jpg']] widths, heights = zip(*(i.size for i in images)) #for horizontal merging: #total_width = sum(widths) #max_height = max(heights) #new_im = Image.new('RGB', (total_width, max_height)) #x_offset = 0 #for im in images: # new_im.paste(im, (x_offset,0)) # x_offset += im.size[0] #for vertical merging: max_width = max(widths) total_height = sum(heights) new_im = Image.new('RGB', (max_width, total_height)) y_offset = 0 for im in images: new_im.paste(im, (0,y_offset)) y_offset += im.size[1] new_im.save('result.jpg') #Ref: https://stackoverflow.com/questions/30227466/combine-several-images-horizontally-with-python ----------------------------------------------------------------------------------------------------