ascii-image
A simple Ruby gem that relies on RMagick to convert an image, local or from a URL, into a sequence of colored ANSI blocks to be displayed nicely on a terminal.
This is the first Ruby gem that I ever developed, and also the first library that I ever published on an online package repository. When I was a lot younger and very naive.
This library was very successful for what it was, with a total of 17k downloads throughout its lifetime (checked on 2025-04-18). I don't know what people were doing with it, since it has no reverse dependencies, but I guess it was mainly wrapped into scripts and used to preview images in the terminal or simply generate ANSI art to embed into bash profiles, which was my main use for it.
screenshots
I was going to provide some screenshots of it in action, but I was unable to find any contemporary ones in my archives or in the history of the GitHub repo, even though I'm pretty certain I had some somewhere, and when I tried using the library on my modern machines it was all kinds of broken and I'm not in the mood to setup a whole Ruby environment just for a screenshot, sorry.
example usage
Using this library is as simple as a one-liner (shown here as two
lines for legibility), all that you have to do is call the
build(width) method with the maximum width
of characters that the ANSI art should be:
require 'ascii-image'
ascii = ASCII_Image.new("~/my_image.jpg")
ascii.build(20)
ascii = ASCII_Image.new("http://www.levihackwith.com/wp-content/uploads/2011/10/github-logo.png")
ascii.build(60)