In start of 2021 - Bernie Sanders Chair Meme gets viral.
This gives me an idea - Can I use python to add my_image with Sir Bernie Sanders image ?
I though, we can do this via Matplotlib & Numpy libraries.
Because we have to arrange the images in some plot (Horizontally/Vertically)
Collage is basically a combination of photos (arranged horizontally, vertically or both)
I have downloaded some images of dogs and cartoon from Google and save it one Folder 'Images'
Using Matplotlib
Step1
First Store Images Path in some array/list.
Step2
Read an Image using Open-CV and Show in a plot and finally save the output
Below is the output
Using Numpy
Numpy provides two method hstack (to stack two arrays horizontally) and vstack (to stack two arrays vertically. So we just use that.
First we read the image in some in a list. Then we read that list and arrange accordingly.
Below is the output
In Numpy method ==> we have hardcoded the rows/columns. But we can write the logic as well (depend on number of images in an array, it arrange accordingly) OR we can take the input form user (about number of rows and columns)