turtleviewer

Last updated: 2017-08-04 18:16:10 +0100

Upstream URL: git clone http://chriswarbo.net/git/turtleviewer.git

Repo

View repository

View issue tracker

Contents of README follows


THIS CODE IS ALL IN THE PUBLIC DOMAIN

This is a converter to possibly the most inefficient image format ever devised. You’ll need pygame to use it, as well as Python with <code>turtle</code> (eg. CPython 2.6)

Given an image filename and an output filename, like this:

<pre><code>python TurtleConvert.py MyImage.png MyImage.py</code></pre>

The file <code>MyImage.py</code> will be created containing Python code to draw the given image, in black and white, using the LOGO-style turtle module.

The output given is the number of pixels left to process. When it reaches zero it’s done, and you can run the output file to draw the image.

This is just an experiment for fun. I hope you enjoy it :)

<ul> <li>Chris Warburton</li> </ul>

TODO

Replace pygame with an imagemagick-style library? Use dithering to convert to black and white, rather than thresholds Optimise the output code: * goto considered harmful (plus it makes things too easy ;) ) * check for straight lines, rather than simply neighbours * when stuck, go to nearest black spot, rather than popping the list * add full colour?