Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
915 B
3
Indexable
Never
from PIL import Image

# Load images
urban_image_1 = Image.open('path_to_urban_image_1.jpg')
urban_image_2 = Image.open('path_to_urban_image_2.jpg')
rural_image_1 = Image.open('path_to_rural_image_1.jpg')
rural_image_2 = Image.open('path_to_rural_image_2.jpg')

# Resize images (optional)
urban_image_1 = urban_image_1.resize((300, 300))
urban_image_2 = urban_image_2.resize((300, 300))
rural_image_1 = rural_image_1.resize((300, 300))
rural_image_2 = rural_image_2.resize((300, 300))

# Create a blank canvas
collage_width = 600  # 2 images wide
collage_height = 600  # 2 images tall
collage = Image.new('RGB', (collage_width, collage_height), color=(255, 255, 255))

# Paste images onto the canvas
collage.paste(urban_image_1, (0, 0))
collage.paste(urban_image_2, (300, 0))
collage.paste(rural_image_1, (0, 300))
collage.paste(rural_image_2, (300, 300))

# Save the collage
collage.save('healthcare_collage.jpg')
Leave a Comment