from PIL import ImageDraw draw = ImageDraw.Draw(<your_image>) draw.rectangle(((20, 30), (10, 10)), fill="white") # (x1, y1), (x2, y2) plt.imshow(test)