Skip to content
✍🏽 --> πŸ“Έ
Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
generated_images
input_text
.gitignore
README.md
batch_process.py
requirements.txt
typewriter.py

README.md

Typewriter

Generate pretty images of text, useful for writing on Instagram. For the following input:

Magic is dead.

It lives like a refugee, in
the spaces between your fingers:

for times when you forget
that your lips are just sensors, and
the thrill down my spine
when you kiss me
is just my brain snorting
information.

the script generates:

Magic

Setup

The Typewriter script uses ImageMagick (NOT the Python library, the script simply calls the CLI) for basic functionality and also scipy/numpy/matplotlib for further optional image processing. I installed the Kingthings font, but you can use any (script defaults to Kingthings).

For setting up on Mac (like I did), you need to first install ImageMagick using something like Homebrew. You can then follow this StackOverflow answer.

Apart from that, if not doing any fancy stuff like Gaussian blurring or smudging (the functions to do so are provided but not used in the script), all you need is Python (2.7). Else, you'll have to run pip install -r requirements.txt to get scipy/numpy/matplotlib.

Usage

For single text, use: $ python typewriter.py input_file output_file [author_name]

The output_file must have a .gif name.

For batch processing multiple text files, use: $ python batch_process.py input_path output_path [author_name]

The batch_process script assumes that all the text files are in the folder specified in input_path, and then it generates the image with the name "typewriter_original-filename" in folder specified by output_path. The main work is done by the generate_image() function in the typewriter.py script. Modify that if things don't work / don't work for you.

Author name is optional parameter. Different accreditation styles can be tweaked in generate_image().

Credits

Worked on by Sneha Sankavaram and Shivan Kaul Sahib.

You can’t perform that action at this time.