Creating a transparent background in a Tkinter window

Tkinter window provides many inbuilt functions and properties to help an application work seamlessly. They configure the GUI of the application as well.

If we want to create a transparent window in an application, then we should have to define the color in the attributes('-transparentcolor', 'color' ) method. By providing the color of the window and widget, it will make the window transparent.


#Import the Tkinter Library
from tkinter import *

#Create an instance of Tkinter Frame
win = Tk()

#Set the geometry of window

#Add a background color to the Main Window
win.config(bg = '#add123')

#Create a transparent window


Running the above code will display a window with a transparent background.

Updated on: 25-May-2021

7K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started