Many years ago I wrote a program to convert images into Python scripts containing "turtle" commands. It's mostly a "cheat" based on "penup" and "GOTO(x, y)", but it can certainly be extended with smarter routing and optimisation algorithms: http://chriswarbo.net/projects/turtleview