0

Is there a way to have an image be created/drawn entirely without the actual Window that usually pops up when starting a turtle script showing up? The reason for this question is that while doing more research into another problem I posted here:

How to properly interact with turtle canvas/screen sizing?

I found that resizing the screen using maximize on the window actually altered what was capture when using .getcanvas() to be saved.

This wouldn't be a problem if I weren't attempting to create large images, larger than my monitors certainly. (around 15000 x 15000 pixels).

Thus I am wondering if there is a way to have the entire drawing process be done in the background. Without a window popping up at all. This way (I would hope at least) my images aren't becoming distorted or incorrectly sized due to buggy window interactions. As an example when I try to create an image this big, even with turtle.tracer(False) set it still flashes for a small amount of time (as the images are large and take time to complete) and while it is 'open' I cannot switch to it, it does not appear on my screen, it only appears on the task bar, which I can hover over and like with other applications 'preview' it without clicking on it, and it does not show there. However the image will be created and saved. But the dimensions are entirely wrong based on the code I used.

For a minimally repeatable example please look to the hyperlink to my related question. The code and subsequent image of that post is directly related to this question. But as the questions are different in nature I decided to create this post asking it.

Any feedback would be greatly appreciated as I cannot find any information in the documentation on how this might be done if it is possible at all. If anyone knows any good resources to directly contact regarding Turtle then that information would be welcomed as well.

martineau
  • 119,623
  • 25
  • 170
  • 301
Darren Woodson
  • 68
  • 1
  • 11

1 Answers1

-1

I'm not sure if this will help to much but if you set the turtles speed to 0 then there will be no animation and the turtle will draw the picture instantly.

The code would look something like: turtle.speed(0)

  • This is true in theory, and I've tried it on my main script not the repeatable example I shared. But when you're creating images as large as I am there is still an amount of time anywhere between 3 seconds to 15 sometimes where the window is still technically open. – Darren Woodson Aug 17 '21 at 18:44
  • My preference due to the seemingly connected nature of the actual window size being related to the canvas size is that the window that shows the drawing not to show up at all and the drawing be done solely on the background – Darren Woodson Aug 17 '21 at 19:00
  • @DarrenWoodson If your images are that large and complicated, you might consider using something other than Turtle. Turtle is primarily designed to be a simple tool for introducing basic programming concepts, not as a full-fledged image creation framework. – 0x5453 Aug 17 '21 at 19:02
  • You're right 0x5453, I've considered that as well, but so far its worked great for what I've been using it for minus this hiccup, so I figured I'd try to chase down a potential solution but I very well could eventually come to that same conclusion. – Darren Woodson Aug 17 '21 at 19:03