Sunday, April 28, 2024
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 2411  / 1 Year ago, sat, january 7, 2023, 12:04:11

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.


More From » software-recommendation

 Answers
0

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:



#!/bin/sh

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

[#31114] Sunday, January 8, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ingsta

Total Points: 391
Total Questions: 103
Total Answers: 124

Location: Bonaire
Member since Wed, Mar 29, 2023
1 Year ago
ingsta questions
Sun, Oct 23, 22, 01:42, 2 Years ago
Sat, Oct 30, 21, 11:27, 3 Years ago
Sun, Nov 28, 21, 12:49, 2 Years ago
;