Pythondex
Sketchpy Python Programs

Python Program To Draw Messi Sketch

Last updated January 31, 2024 by Jarvis Silva

In this tutorial I will show you how to create a python program to draw Messi sketch, Lionel Messi GOAT of football a legend and my favourite football player so I decided to use my python skills to draw messi.

To draw Messi in python we will use the sketchpy library, it will allows us to draw sketch of anything by just providing a image so before coding you will need to first install the library to install use below command:


pip install sketchpy

After installing the library let’s see the code.

Python code to draw Messi


from sketchpy import canvas

img = canvas.sketch_from_svg("messi.svg",scale=70)

img.draw()

Above is the 3 lines of code which will draw messi sketch that is the power of using a library it extracts all the complex code, you can see in the code I have given a messi.svg image file to the function from which it will draw the sketch.

So before running this program you need to image of messi in svg format, below is the svg image I have used for this program download it.

After downloading move it in your python program folder and enter the image path name in the canvas.sketch_from_svg() function.

Now if you run this program you will see a progress bar loading in your terminal after it completes it will open a new window and start drawing Messi sketch, below is the final output you will get.

Messi Drawing

Also Draw Ronaldo Using Python With Code.

As you can see from the above image we successfully drawn Messi sketch using python, I hope you found this article helpful and useful, do share it with someone who might find it intresting and is a fan of Messi. Thank you for reading, Have a nice day 😊