Introduction
This blog will discuss how to Draw Instagram Logo using Python Turtle module. Instagram is a very popular social media platform, primarily used for uploading and editing photos in the past, but it has now become a short-video platform with the introduction of Instagram Reels.
Click here to check how to draw Instagram Reels logo using Python Turtle.
Basics of the Python Turtle module: https://copyassignment.com/the-beginners-guide-to-python-turtle/
Official Documentation of the Turtle module: https://docs.python.org/3/library/turtle.html
Complete code to Draw Instagram Logo using Python Turtle
from turtle import * #importing the module def backFrame(): COLOR = (0.60156, 0, 0.99218) # (154, 0, 254) TARGET = (0.86328, 0.47656, 0.31250) # (221, 122, 80) screen = Screen() screen.tracer(False) WIDTH, HEIGHT = screen.window_width(), screen.window_height() #defining some useful variables deltas = [(hue - COLOR[index]) / HEIGHT for index, hue in enumerate(TARGET)] turtle = Turtle() turtle.color(COLOR) turtle.penup() turtle.goto(-WIDTH/2, HEIGHT/2) turtle.pendown() direction = 1 #the gradient background for distance, y in enumerate(range(HEIGHT//2, -HEIGHT//2, -1)): turtle.forward(WIDTH * direction) turtle.color([COLOR[i] + delta * distance for i, delta in enumerate(deltas)]) turtle.sety(y) direction *= -1 screen.tracer(True) def main(): ## setting all the pre-defined values to be used in the program pen_color = 'white' width_val = 23 round_coordA, round_coordB = 34, 90 circleAx, circleAy = 80, 360 circleBx, circleBy = 7, 360 gotoAx, gotoAy = 85, 30 gotoBx, gotoBy = 160, -100 pencolor(pen_color) #defining the color of the pen width(width_val) #defining the thickness of the pen penup() #start the draw goto(gotoBx, gotoBy) #set the origin for the graphics pendown() #stop the draw temporarily left(90) #turn at an angle for i in range(4): #loop for 4 times for a square-type shape forward(250) circle(round_coordA, round_coordB) #for border-radius penup() # for the big circle goto(gotoAx, gotoAy) # defining the new origin for the pen pendown() # stopping the draw circle(circleAx, circleAy) #built-in function for a circle in the middle penup() goto(110,130) # setting the new origin pendown() circle(circleBx, circleBy) # built-in function for a circle at the top-right done() # end the program if __name__ == "__main__": backFrame() main()
Output:
Explanation the Code for the Instagram Logo using Python Turtle:
The backFrame() function for creating background:
def backFrame():
COLOR = (0.60156, 0, 0.99218) # (154, 0, 254)
TARGET = (0.86328, 0.47656, 0.31250) # (221, 122, 80)
screen = Screen()
screen.tracer(False)
WIDTH, HEIGHT = screen.window_width(), screen.window_height() #defining some useful variables
deltas = [(hue - COLOR[index]) / HEIGHT for index, hue in enumerate(TARGET)]
turtle = Turtle()
turtle.color(COLOR)
turtle.penup()
turtle.goto(-WIDTH/2, HEIGHT/2)
turtle.pendown()
direction = 1
#the gradient background
for distance, y in enumerate(range(HEIGHT//2, -HEIGHT//2, -1)):
turtle.forward(WIDTH * direction)
turtle.color([COLOR[i] + delta * distance for i, delta in enumerate(deltas)])
turtle.sety(y)
direction *= -1
screen.tracer(True)
The main() function of Instagram Logo using Python Turtle:
1. Importing the Turtle module and defining variables to be used:
def main():
## setting all the pre-defined values to be used in the program
pen_color = 'white'
width_val = 23
round_coordA, round_coordB = 34, 90
circleAx, circleAy = 80, 360
circleBx, circleBy = 7, 360
gotoAx, gotoAy = 85, 30
gotoBx, gotoBy = 160, -100
pencolor(pen_color) #defining the color of the pen
width(width_val) #defining the thickness of the pen
penup() #start the draw
goto(gotoBx, gotoBy) #set the origin for the graphics
pendown() #stop the draw temporarily
left(90) #turn at an angle
for i in range(4): #loop for 4 times for a square-type shape
forward(250)
circle(round_coordA, round_coordB) #for border-radius of Instagram Logo using Python Turtle
penup() # for the big circle
goto(gotoAx, gotoAy) # defining the new origin for the pen
pendown() # stopping the draw
circle(circleAx, circleAy) #built-in function for a circle in the middle
penup()
goto(110,130) # setting the new origin
pendown()
circle(circleBx, circleBy) # built-in function for a circle at the top-right
done() # end the program
2. Setting the origin for the initial graphics
pencolor(pen_color) #defining the color of the pen
width(width_val) #defining the thickness of the pen
penup() #start the draw
goto(gotoBx, gotoBy) #set the origin for the graphics
pendown() #stop the draw temporarily
3. Drawing the initial square-type shape with border-radius
left(90) #turn at an angle
for i in range(4): #loop for 4 times for a square-type shape
forward(250)
circle(round_coordA, round_coordB) #for border-radius of Instagram Logo using Python Turtle
4. Setting origin and drawing the big circle
penup() # for the big circle
goto(gotoAx, gotoAy) # defining the new origin for the pen
pendown() # stopping the draw
circle(circleAx, circleAy) #built-in function for a circle in the middle
5. Drawing the dot on the top right
penup()
goto(110,130) # setting the new origin
pendown()
circle(circleBx, circleBy) # built-in function for a circle at the top-right
6. End the program
done() # end the program
7. Last Part
if __name__ == "__main__":
backFrame()
main()
After reading this article, I hope you have learned how to draw the Instagram Logo using Python Turtle.
Also Read:
- Radha Krishna using Python Turtle
- Drawing letter A using Python Turtle
- Wishing Happy New Year 2023 in Python Turtle
- Snake and Ladder Game in Python
- Draw Goku in Python Turtle
- Draw Mickey Mouse in Python Turtle
- Happy Diwali in Python Turtle
- Draw Halloween in Python Turtle
- Write Happy Halloween in Python Turtle
- Draw Happy Diwali in Python Turtle
- Extract Audio from Video using Python
- Drawing Application in Python Tkinter
- Draw Flag of USA using Python Turtle
- Draw Iron Man Face with Python Turtle: Tony Stark Face
- Draw TikTok Logo with Python Turtle
- Draw Instagram Logo using Python Turtle
- I Love You Text in ASCII Art
- Python Turtle Shapes- Square, Rectangle, Circle
- Python Turtle Commands and All Methods
- Happy Birthday Python Program In Turtle
- I Love You Program In Python Turtle
- Draw Python Logo in Python Turtle
- Space Invaders game using Python
- Draw Google Drive Logo Using Python
- Draw Instagram Reel Logo Using Python
- Draw The Spotify Logo in Python Turtle
- Draw The CRED Logo Using Python Turtle
- Draw Javascript Logo using Python Turtle
- Draw Dell Logo using Python Turtle
- Draw Spider web using Python Turtle