Encoding Text as an Image

 

encoder.py is a simple Python program that convert a command line string into an image made up of letter pictures using the Pillow module. The image's dimensions are roughly square, with randomly added spaces to make the string a suitable length.

For example:

python encoder.py -f "This is a top secret message"
generates:

Framed image

-f uses framed letter images. The same call without -f produces:

Unframed image

The letters come from Erik Demaine, Martin Demaine, Donald E. Knuth, and Yushi Uno's 2-piece connected Dissection Font. For many more wonderful fonts, visit the parent page.

Downloads

 

Dr. Andrew Davison
E-mail: ad@coe.psu.ac.th
Back to my home page