I have an array 

```
arr = [[1,0,0,1], 
       [1,1,1,1], 
       [1,1,1,0]]

```

I want to create an image that makes a green box where there is a 1 and a red box where there is a 0

P.S. I do not want to make a plot, but an image. 

Using Tkinter, I am getting all the boxes in a single row, but I need it to be arranged in rows and columns like in the 2D array. 
In my code, I am not able to figure how to move to a new line after printing the boxes corresponding to a row

```
import tkinter as tk

root = tk.Tk()
arr = [[1,0,0,1], [1,1,1,1], [1,1,1,0]]
for i in range(len(arr)):
    for j in range(len(arr[i])):
        if arr[i][j]==0:
            w = tk.Label(root, text="red", bg="red", fg="white")
            w.pack(padx=5, pady=10)
        elif arr[i][j]==1:
            w = tk.Label(root, text="green", bg="green", fg="black")
            w.pack(padx=5, pady=20)
        w.pack(side=tk.LEFT)
    # need something here to move to a new line after printing each row
tk.mainloop()

```

Current Output : 
[![enter image description here](https://i.stack.imgur.com/nJL10.png)](https://i.stack.imgur.com/nJL10.png)