Use screen.bgcolor(...) to set a solid Python Turtle background and screen.bgpic(...) to display an image. The color method accepts color strings, hex values, and RGB input; numeric RGB values must match the screen’s color mode.
Change the Python Turtle background color
Create a Turtle screen, then pass the color to bgcolor(). The method accepts a Tk color specification string, an RGB tuple, or three RGB arguments.
As an Amazon Associate I earn from qualifying purchases.
import turtle
screen = turtle.Screen()
screen.bgcolor("lightblue")
turtle.done()
Color names such as "lightblue" and hex strings such as "#800080" are string inputs. Use whichever format is clearest for your code.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Use a hex color in Turtle
Pass the hex color as a string to bgcolor():
import turtle
screen = turtle.Screen()
screen.bgcolor("#800080")
turtle.done()
The official Python 3.14.7 reference uses "#800080" as an example and shows that the screen reports it as the RGB tuple (128.0, 0.0, 128.0) when read back. Python turtle.bgcolor() reference
#1 Best Overall
Set an RGB background color
You can pass RGB components as a tuple or as three separate arguments. The allowed component range depends on screen.colormode(), which is either 1.0 or 255; each component must be within the selected range.
import turtle
screen = turtle.Screen()
screen.colormode(255)
screen.bgcolor((128, 0, 128))
# Equivalent: screen.bgcolor(128, 0, 128)
turtle.done()
With the default 1.0 mode, use component values from 0 to 1 instead. Set the mode deliberately before supplying numeric components so the values use the range you expect. Python turtle.colormode() reference
Rank #2
Add a background image to Turtle
Use bgpic() with the image filename or path. The Python 3.14.7 reference documents PNG, GIF, PGM, and PPM formats.
import turtle
screen = turtle.Screen()
screen.bgpic("landscape.gif")
turtle.done()
The file needs to be available at the path your program supplies. If it does not appear, check that the path resolves from the running program and that the file uses a documented format; behavior can depend on the installed environment. Python turtle.bgpic() reference
To remove the current background image, call screen.bgpic("nopic"). Calling screen.bgpic() without an argument returns the current image name.
Color or image: which method should you use?
| What you want | Method | Input |
|---|---|---|
| Flat background | bgcolor() |
Color name, hex string, RGB tuple, or three RGB arguments |
| Picture behind the drawing | bgpic() |
Local image filename or path in PNG, GIF, PGM, or PPM format |
These methods serve different purposes: bgcolor() sets a solid color, while bgpic() sets a background image.
Reapply the background after a reset
Turtle’s documented reset state has a white background and no background image. If a screen reset clears your chosen background, call bgcolor() or bgpic() again after the reset. Python turtle.Screen reference
Recommended Free Tools
Quick Recap
Best Value
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




