michael-lazar / playscii

Fork of playscii
https://heptapod.host/jp-lebreton/playscii
MIT License
41 stars 5 forks source link

format specification for exporting ANSI art text files #2

Closed nnako closed 2 years ago

nnako commented 2 years ago

Using Playscii's functionality, I have imported a bitmap image as described within the following YouTube video:

https://www.youtube.com/watch?v=nr49LV0Ks_Y

When exporting the generated piece of art in "AMS" text format as described within the video, I get a text file which is auto-detected as "ANSI" (e.g. using Notepad++). Looking at the generated characters, I see loads of differences to "ordinary" ANS files, as their format is defined here:

https://en.wikipedia.org/wiki/ANSI_escape_code#SGR

Part of an example export file generated with Playscii:

<ESC>[0;29;39m<NULL><ESC>[0;30;42md<ESC>[0;30;43m<NULL>...

There are some formal elements (e.g. "" characters and non-standard select graphics rendition parameters) which don't seem to fit to the "normal" ANS format. They seem to suppress / disturb a proper art display within the command line. On Windows systems, ANS files can be directly opened (viewed) using the "type" command:

type <ANSI-ART-FILE>.ans

This notmally results in properly colored ANSI art contents when fed with proper ANS files. Very nice. But with exported text files looking as the one sketched above, the output does not have anything in common with the original piece of art visible within Playscii.

Which formal specification does the ANS export feature follow? Is there a way to display the ANS exports within the "normal" Windows command line (e.g. using the "type" command) or are there any general obstacles to this?