import numpy import cv2 img_array = [[[0,0,255,66]for i in range(255)]for j in range(100)] img_numpy = numpy.array(img_array) cv2.imwrite("1.jpg",img_numpy)