This is a program that can be used to generate an image that sort of looks like a cross-stitch pattern. Depending on how poor your eyesight is, it may appear to function correctly. I wrote it to use in my Text Me, Troll Me project (to be put online when it's closer to completion). The idea is based on Andrew Kleindolph's sms-cross-stitch project, although his project is much nicer looking.
The patterns/
directory contains patterns that you can throw together to
create your own image. All of the non-letter images came from the ASCII Art
Archive. I saved the original in a file called
shape_name.txt, and the modified ones for use by my program in shape_name.xsp. Mostly, I just removed author initials, but I also did some minor re-shaping with some of them.
I generated all of the letter patterns using the figlet program and the banner3 font with this bash command:
for letter in `echo {A..Z}`; do figlet -f banner3.flf $letter > $letter.xsp; done
To create the virtual environment and install the required packages, run the
./create.sh
script.
The script takes four parameters, with an optional fifth:
- Width of the image
- Height of the image
- Number of steps (stitches) across the image
- Message to display
- Input image filename (chosen at random if blank)
For example, this command ould produce the following image:
$ python main.py 800 300 200 "the ivory trade sucks" --input_filename patterns/baby_elephant.xsp