Is there a command-line program that can convert an image to ascii art and then save that output as an image e.g. jpg or png?

To illustrate what I'm in need of, I want to convert the image below into ascii art enter image description here

The output that I desire from a program should be similar to this one, which was created by taking a screenshot of the output of an image-to-ascii converter (the output was pure text)

enter image description here

I'm aware that GIMP has the ability to save an image as ascii art and aview can also convert an image to ascii. However, the former cannot be done via the command line and the latter only lets you view the output, not save it (I don't want to resort to taking a screenshot of the output).

I'm also aware that libcaca can save its output to an image, but it only outputs colourful ascii, like below.

enter image description here

Made by converting the source image to greyscale and then with the following command:

img2txt -W 70 -f tga input.jpg > output.tga

The reason for wanting a command-line program is to batch process a folder full of images.

  • 2
    Change the image to black and white before using libcaca?
    – Bert
    May 21, 2013 at 13:55
  • Everything you can do in GIMP can be done from command line. May 21, 2013 at 15:19
  • @OlegV.Volkov Can you tell me exactly how to accomplish this task? May 22, 2013 at 6:41
  • No, I can't tell you exactly, because it I only used GIMP's Scheme based scripting a few times and figuring proper API for your question would take just too much time for me right now. I can direct you to relevant docs though: docs.gimp.org/en/gimp-concepts-script-fu.html. May 22, 2013 at 8:54
  • @Bert I tried using a greyscale and black/white image. It occasional still renders to a colourful output and still uses coloured/shaded tiles as a background. I want it in pure ascii, which just uses b/w text May 22, 2013 at 21:38

2 Answers 2


When you say you don't want to resort to taking a screenshot, do you mean that you don't want to have to resort to taking a screenshot manually? Generating images with aview and taking screenshots of the results could be automated. For example:


aview $1 &
sleep 1 # Give aview time to map its window.
xwd -name "aa for X" | convert - $2
kill $pid

It is not an answer to the final question, but a hint, if you just read the title: Why use ascii? If you just search for a way to get a hint of images on the console, better use a terminal with Sixel support and show images directly in the terminal:

apt install libsixel-bin mlterm
img2sixel test.jpg

works on Ubuntu 19.10!

enter image description here

  • 1
    You've completely missed the point of the question. The goal is not just to display the image in a terminal. ascii is the desired output. Nov 5, 2019 at 21:52
  • I was ending up here at this question when I was searching for a way to watch images on the console and thought ASCII would be the solution. Your question title sounds like that. So after some more research I found out that there is an even better solution for my problem. I thought it would be nice to share it with you, just in case
    – rubo77
    Nov 6, 2019 at 13:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .