DEV Community

Cover image for Ascii Art via the Command Line
Daniel J
Daniel J

Posted on

Ascii Art via the Command Line

There is something truly special about creating something visually using technology. The ability to use a bunch of binary digits to make something visually appealing for us humans. It's something so far removed from the original idea behind computer systems that it reminds me of the vast and endless opportunities we have as intelligent beings. That being said, it must be pointed out, the juxtaposition between working in a command line interface, and displaying some sort of art or image by using ASCII characters in said interface that's designed to be text based. Pushing the limits of technology is how we got to this point in the first place.

The American Standard Code for Information Interchange (ASCII) is an encoding standard for communication between electronic devices. It was originally created out of a need for standardizing the communication's sent and received by our devices. It was used to encode up to 128 characters into different 7 bit integers. This was incredibly important and necessary to make our systems uniform and compatible. These days Unicode has taken the place of our standard encoding system and offers millions of code points compared to ASCII's 128, but the concept of using text characters to create art lives on.

Originally, there was an artistic use to ASCII characters that was created near it's inception. It came due to the unreliability and imprecisions of modern day printers at the time. In the 60's and 70's printer technology wasn't nearly as good as it is today, they certainly weren't able to tweet off of their dot matrix printers like we can today with certain models. The resolution for image printing was difficult to get right and often not possible. In turn the idea was born to use dot's and other ascii characters to draw a larger image, producing higher resolution images than most standard printers.
This is an image printed in 1961 using a teleprinter
1961 image of dag

These days ASCII art is much more expressive and free, often created as small ascii characters, phrases or pop culture references. The limits don't have to stop there however, as that is a great area of overlap for art and technology. Pushing the limits of what we have to create things we didn't think we could like creating art inside of our terminal! We can create something small and fun like the fortune | cowsay terminal packages that give you a "fortune" being told to you by an ascii cow.

fortune cowsay

Alternatively, if you are a math wizard and a programming wizard (AKA knowledge of programming in C), you can make something incredibly complex, like a rotating donut. (I can only show multiple screenshots due to formatting limitations.)

first donut

second donut

Third Donut

Top comments (0)