
Show HN: 24bit RGB "AnsiArt" Terminal Image Viewer - dukoid
https://github.com/stefanhaustein/TerminalImageViewer
======
tracker1
This is pretty cool, though I've seen similar utilities already (there are
several active BBS groups on Facebook, and a few of us relatively old timers
out there.

To me, a big part of the nostalgia of ANSI as it was through the 80's/90's was
the skill it took to get something to look like anything with the
block/shading characters, 16 foreground and 8 background colors. Even getting
the color pallet right in modern apps is pretty off compared to original DOS,
which was based on 252,252,252 being white, from there, the offsets are
proper.

It's an interesting time we live in... UHD monitors, with more room than I
could have imagined in front of me over 20 years ago, when 640x480 was
typical, and 1024x768 was cutting edge... let alone a big color range.

~~~
dukoid
Thanks! I haven't seen one that does 24bit RGB + shape matching, would be
interested in pointers (shading chars don't make sense in 24 bit color space).

Unfortunately I had to remove some of the more interesting diagonal shapes
because they are wider than the character cell -- despite the monospaced
font... :-/

I actually wrote this because I wanted to test my "pure Java" implementation
of strict Typescript by running the raytracer example -- without needing to
add a windowing library or image encoder:
[https://github.com/stefanhaustein/typo](https://github.com/stefanhaustein/typo)

Got the idea to extract the terminal image viewer from an Ubuntu stackexchange
post asking for a tool that would display image thumbnails in the shell
without opening a new window: [http://askubuntu.com/questions/97542/how-do-i-
make-my-termin...](http://askubuntu.com/questions/97542/how-do-i-make-my-
terminal-display-graphical-pictures/185088)

If you run the tool on an image directory, I think you get a pretty good idea
what's in the images from the thumbnails (compared to 16bit color)

~~~
tracker1
It's absolutely useful... I wasn't meaning to seem dismissive of that. It's
just that I usually think of a lot of these things in terms of past
compatibilities.

------
dunwsrt
This is very cool and produces nice looking output. Well done!

However, I feel like the draw of a tool like this is that it can run in
minimalist environments where a GUI is not available. I'm not sure how I feel
about having to spin up a JVM to use it.

~~~
dukoid
Thanks! I fully agree. Most of the code probably can be ported to C(++)
without much change, it's just a few loops over arrays, except for the image
loading part. Best solution might be to extend a similar existing unix tool.
Can you recommend any (ideally with the source on github)?

------
tvmalsv
And, while not quite the same thing, if you are a user of iTerm2, it includes
the script "imgcat" that will display an image directly in the terminal
window.

[https://www.iterm2.com/documentation-
images.html](https://www.iterm2.com/documentation-images.html)

~~~
dukoid
Maybe somebody should write an RFC... Not sure how complex this would be to
support in terminals in general though. After all, you may suddenly need much
more information per cell than the 2 ints for the code point and color...

~~~
illicium
[https://en.wikipedia.org/wiki/Sixel](https://en.wikipedia.org/wiki/Sixel)

~~~
dukoid
Doesn't look very convincing: How would one assign colors to individual
pixels?

