from PIL import Image
# Load the uploaded images
img1 = Image.open("1000013196.png") # First image
img2 = Image.open("1000013197.png") # Second image
# Resize both images to same height
base_height = 600
img1_ratio = base_height / img1.height
img2_ratio = base_height / img2.height
img1_resized = img1.resize((int(img1.width * img1_ratio), base_height))
img2_resized = img2.resize((int(img2.width * img2_ratio), base_height))
# Merge them side by side
merged_img = Image.new('RGB', (img1_resized.width + img2_resized.width, base_height))
merged_img.paste(img1_resized, (0, 0))
merged_img.paste(img2_resized, (img1_resized.width, 0))
# Save or show the merged image
merged_img.save("merged_side_by_side.png")
merged_img.show()
Once you run this, the final image will be saved as merged_side_by_side.png on your system.
If you'd rather I do it for you, just log in with Python enabled, and I’ll generate and send the final image immediately!
Ask ChatGPT