You are not logged in.

#1 2013-02-13 07:10:32

Xyne
Forum Fellow
Registered: 2008-08-03
Posts: 6,965
Website

image to ascii art and back converters

I've wanted to find a good image to ascii art converter for ages but have never found one that did everything I'd hope. I had another look today and rediscovered aalib and libcaca. I haven't look into the libraries themselves because I don't want to write my own application (yet?).

libcaca's img2txt looked promising at first but it seems to be limited to the basic 16 color terminal palette even in urxvt-256-unicode. Is there some setting that determines this? I would really like to try to watch videos in mplayer using 256 colors or more. I've tried using the different driver env variables but they all seem to use 16 colors. It even uses 16 colors when generating TGA image files.

I also discovered jp2a which is great so far. It's slightly annoying that it's limited to jpg (wtf would anyone choose jpg as your input format for a conversion utility?) but imagemagick's "convert" and some piping do the trick. Again it seems that jp2a only uses the basic 16 bit color palette when printing to the terminal, but it has a full palette when generating html. Unfortunately it doesn't seem to be able to generate image files, only direct console ascii and HTML.

For now I have added jp2a to tiv as an optdep. It uses the full terminal color palette and can even adapt the palette per image to make the most of it. I get some nice ascii output now with "tiv -r 0.6 -a -j /path/to/img". But that as well lacks the ability to convert back to an image format.

Is there nothing that can convert image files to (full-palette, i.e. >= 256) colored ascii art and then convert the output to its own image? I would really like a way to do batch conversions (e.g. to convert films, if no mplayer codec can do it).

In particular, does anyone have any simple ideas for converting an HTML-encoded ascii image to a real image file? I expect that it would be relatively simple to use webkit to create a simple utility for this, but I doubt that it would be  easy to do quickly without any experience of webkit.

*sigh*

Last edited by Xyne (2013-02-13 07:10:55)


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#2 2013-02-13 07:48:55

progandy
Member
Registered: 2012-05-17
Posts: 5,321

Re: image to ascii art and back converters

In particular, does anyone have any simple ideas for converting an HTML-encoded ascii image to a real image file? I expect that it would be relatively simple to use webkit to create a simple utility for this, but I doubt that it would be  easy to do quickly without any experience of webkit.

Just use gnome-web-photo:

gnome-web-photo http://archlinux.org test.png

| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#3 2013-02-13 18:32:15

Xyne
Forum Fellow
Registered: 2008-08-03
Posts: 6,965
Website

Re: image to ascii art and back converters

@progandy
Thanks! big_smile

(it seems a bit slow, but otherwise that is perfect... also small despite being gnome-* tongue)


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

Board footer

Powered by FluxBB