i am not getting how to insert 5th image at the centre .
Instagram like collage
Hi @chamoliabhishek007 the logic I used to add the fifth image at the centre is:
Create a Blank Image of Dimension (220,220) and add our center image
in the center of this blank image ----> This will generate Image(our center image having border 10 along all edges) as follows:
Now you just need to add this newly generated image to the center of your image collage having:(top_left , top_right , bottom_left , bottom_right )
You can refer to this code for better understanding:
import cv2
from google.colab.patches import cv2_imshow
import numpy as np
import csvdim=(200,200) #Dimension of each Image
border=10 #Border
bot_left=cv2.resize(cv2.imread(’/content/bottom_left.jpg’),dim)
bot_right=cv2.resize(cv2.imread(’/content/bottom_right.jpg’),dim)
center=cv2.resize(cv2.imread(’/content/center.jpeg’),dim)
top_left=cv2.resize(cv2.imread(’/content/top_left.jpg’),dim)
top_right=cv2.resize(cv2.imread(’/content/top_right.jpg’),dim)center_image = np.zeros((dim[0]+2border,dim[1]+2border,3), np.uint8) # Creates a blank image of dim = (220,220)
center_image[border:dim[0]+border,border:dim[1]+border] = center # create the center image with borderout_image = np.zeros((430,430,3), np.uint8) #will create the final output image (currently a black image of dimension= (430,430))
out_image[10:210,10:210]=top_left
out_image[10:210,220:420]=top_right
out_image[220:420,10:210]=bot_left
out_image[220:420,220:420]=bot_right
out_image[105:325,105:325] = center_imagecv2_imshow(out_image)
Hope this might helps
yes got the output ,but havent studied this below code in lecture:
Hi @chamoliabhishek007 I have explained the code in detail with you via chat. Please have a look for better understanding
Sorry for being off-topic, but is there a similar topic to yours, regarding TikTok? I often come here to see some useful tips for creating and designing content, but I decided to develop my accounts not only on Instagram. But I see mentions of Instagram much more often. I don’t even know if the same toolkit can be applied to TikTok. In my case, it turned out to be easier to find how to Gain Natural Followers on TikTok than to deal with all the possibilities of content design. I’ll be grateful for any advice.