1

When I run command asciiview image.jpg I'm able to view image in the terminal and quit browser using q key. I've tried different ways to redirect the output of the asciiview image.jpg to the console output (stdout) or save in the file such as asciiview image.jpg > ascii_art.txt or asciiview -driver stdout image.jpg > ascii_art.txt but I didn't get a result as I'm expecting. In the first case, I had to manually press Ctrl+C to get a proper image in the text file, in the second case I didn't get anything meaningful that would resemble the picture. Have anyone ideas how I can save image produced by asciiview directly to file or display it in the console output without entering browser and having to press q key?

0

Have you tried echo q | asciiview ?? That seems to be how others have handled embedding asciiview in their process.

"echo q | asciiview -driver stdout -kbddriver stdin %s 2>/dev/null"

The -kbddriver stdin also looks important here. Throwing errors into /dev/null is also worth considering.

  • When I set driver stdout the result isn't the same quality as ASCII art produced by the same asciiview %s command. Example: - image produced by command asciiview %s: imgur.com/a/IGeeLxi, - image produced by command echo q | asciiview -driver stdout -kbddriver stdin %s 2>/dev/null: imgur.com/a/aqCQvhs – java-devel May 12 at 18:38
  • Playing with your terminal width might help. Further investigation would require digging into the source code. aa-project.sourceforge.net has links to the sources and mentions some other packages, like gimp, that supposedly have interoperability with with asciiview. – chicks May 12 at 18:58
  • Does exist any simpler way to achieve it? I tried other programs such as jp2a or img2txt but asciiview gives me the best results. – java-devel May 14 at 19:42
  • Not that I can think of. – chicks May 14 at 20:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.