import numpy as np
import pandas as pd
import matplotlib.pyplot as plt

top_left = cv2.imread('top_left.jpg')
top_left = cv2.cvtColor(top_left,cv2.COLOR_BGR2RGB)
top_left = cv2.resize(top_left,(200,200))

top_right = cv2.imread('top_right.jpg')
top_right = cv2.cvtColor(top_right,cv2.COLOR_BGR2RGB)
top_right = cv2.resize(top_right,(200,200))

bottom_left = cv2.imread('bottom_left.jpg')
bottom_left = cv2.cvtColor(bottom_left,cv2.COLOR_BGR2RGB)
bottom_left = cv2.resize(bottom_left,(200,200))

bottom_right = cv2.imread('bottom_right.jpg')
bottom_right = cv2.cvtColor(bottom_right,cv2.COLOR_BGR2RGB)
bottom_right = cv2.resize(bottom_right,(200,200))

center = cv2.imread('center.jpeg')
center = cv2.cvtColor(center,cv2.COLOR_BGR2RGB)
center = cv2.resize(center,(100,100))
center = cv2.copyMakeBorder(center,10,10,10,10,cv2.BORDER_CONSTANT)

image = np.zeros((430,430,3),dtype="int")
image[10:210,10:210] = top_left
image[10:210,220:420] = top_right
image[220:420,10:210] = bottom_left
image[220:420,220:420] = bottom_right
image[155:275,155:275] = center

x = np.array(image)
df = pd.DataFrame(x.reshape(-1,3))
y = df.rename(columns={0:'r',1:'g',2:'b'})
y.to_csv('b.csv',index=False)