Q:

Removing white space around images with Tkinter

So I was just messing around with Tkinter and wanted to try and put two images right next to each other. I got the images in using tk.PhotoImage but when i placed them next to each other using grid, there is this white space in between the images. Is there any way to remove this?
Source Code:
import tkinter as tk

root = tk.Tk()
img2 = tk.PhotoImage(file='blue.png')
ree2 = tk.Label(root, image=img2)
img4 = tk.PhotoImage(file='green.png')
ree4 = tk.Label(root, image=img4)
ree2.grid(row=2, column=2)
ree4.grid(row=2, column=1)
root.mainloop()

A:

You can use the option borderwidth to change the width of the border around the images.
img2 = tk.PhotoImage(file='blue.png')
ree2 = tk.Label(root, image=img2, borderwidth=0)
img4 = tk.PhotoImage(file='green.png')
ree4 = tk.Label(root, image=img4, borderwidth=0)

Setting it to 0 will remove the whitespace you are seeing.

