Making ASCII Art With AI

Meytal Markman
AI & Generative AI
Published in
3 min readApr 5, 2024

Are you going to stop reading right now if I admit that today was the first time that it occurred to me to ask ChatGPT to create ASCII art?

Very well — leave if you must, I’ll wait while you walk to the back of the room and push through the double doors…

This is what happens when you use a python script to create ASCII art from a picture.

For those who are sticking around — thanks.

The thing that sparked this not-so-novel idea for me this week, was that we released our first (!!) TechExplorer.AI newsletter and I included this cute little bit of ASCII art that showed a scale:

Interesting | — — o — — — — | Useful

…and from there I was reminded of the simple pleasure of good old-fashioned ASCII art. So I went to ChatGPT and asked it to create me some ASCII art of an astronauts helmet (because that’s our TE.AI logo) and well, let’s just say that it left something to be desired:

This is what happened when I asked ChatGPT to create ASCII art of an astronaut’s helmet.
Photo by Patrick Perkins on Unsplash

Not to be deterred, I tried again. “Thanks! What if I send you an image file and you try to get as close to that as possible using ASCII only?” (Note the “Thanks!” up front there — gotta set a good example for the robots who always be learnin’.)

What happened next was, well, worth a blog post!

1 — It asked me to upload a picture. Cool, cool, nothing special there.

2 — It confirmed receipt of the picture and asked me to give it some time. Cool, doing some expectation setting. OK.

3 — It came back and said, “Due to the text limitations in this chat, I cannot display the entire image here. But, I’ve saved the ASCII art as a text file that you can download and view in full.” Wait, what? This is the first time that ChatGPT has ever returned a FILE to me! Has anyone seen this before? I downloaded the file from here: https://files.oaiusercontent.com/.

4 — It gave me the python code that it used to generate this beautiful piece of art:

ASCII Art Generated from Python Code using the TechExplorer.AI Astronaut Helmet logo.

So now, not only did I learn something, I also have a handy little python script for generating ASCII art from an image, and not just any ASCII art — actually good ASCII art. :) Enjoy!

--

--