import cv2 import numpy as np img = np.zeros((512,512)) # gray scale image (can check by shape also ) # To add the color make it 3 channel img = np.zeros((512,512,3)) #img[:]=255,0,0 ''' To Draw the line ,Rectange ,Circle and put text on images ''' cv2.line(img,(0,0),(300,300),(0,255,0),3) # start point ,end point and thickness cv2.rectangle(img,(0,0),(250,350),(0,0,255),4) # start point ,end point and thickness(or can fill also fuly) cv2.circle(img,(400,50),30,(255,255,0),5) #center point,radius ,color and thickness cv2.putText(img,"OPENCV",(300,300),cv2.FONT_HERSHEY_DUPLEX,1,(0,255,0),3) cv2.imshow("Image", img) cv2.waitKey(0)