Jump to content

Picture to python turtle

I am new to coding, we are learning it slowly in school and for the end of the year we need to make a simple click game.

I know how to do everything but to make my process quicker i want to know if there is a program that converts a simple picture into raw python turtle code? 

We are doing it in an online program so i cant just import a picture as background.

Thanks

Link to comment
Share on other sites

Link to post
Share on other sites

I've done this once. I forget which library I used to do the image processing.

What you'll need is a way to read the image, get it's size, and get a color value for each pixel. Set your canvas up to be the same resolution as the image, and start moving the turtle along the canvas, looking up what color it should be drawing by reading that pixel in the image.

Be warned though, drawing a picture with turtle graphics in python is OVERWHELMINGLY slow, especially if you have to change colors frequently.

ENCRYPTION IS NOT A CRIME

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×