I’ve been experimenting, after a long break, with jp2a again, converting captured images into ASCII representations, which are then sent to a local printer. I remember, long ago and as a child, having my face printed onto a t-shirt in Blackpool. The ASCII character set made up the individual “pixels”.
With this experiment, I’ve used an old Deskjet 930c printer and a cheap USB web cam.
From a software point-of-view, I’ve installed the following:
- CUPS – The Unix Printing System
- jp2a – Takes a jpeg image and turns it into ASCII text
- GUVCVIEW – captures images from a webcam
- Figlet – to create the text for an interesting banner at the bottom of the page
“lp” is the command that sends this text to the printer. There are loads of command line options available. I’ve wrapped this all up in a bash script and set it to run from the command line by making it executable.
To make this all work, I capture an image and it gets saved as my_photo.jpg. I then run the script shown above, typing ./printphoto.sh and the printer spews out a rendered version of whoever is in front of the camera. Neat… and I’ll demo it at the next Raspberry Jam.
Future options would be to use a big button to start the whole process off. I’ve done it before, but there’s not enough time remaining for that.