Last active
September 19, 2020 13:48
-
-
Save kerenskybr/9bc81f1e21a60f66d7f122a80d39971e to your computer and use it in GitHub Desktop.
Concat two images towards the height
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import Image | |
def concat_images(im1, im2): | |
""" Concat two images towards the height | |
""" | |
dst_img = Image.new('RGB', (min(im1.width, im2.width), im1.height + im2.height)) | |
dst_img.paste(im1, (0, 0)) | |
dst_img.paste(im2, (0, im1.height)) | |
return dst_img |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment