MAGICBIFF - A better online image-to-ascii converter tool
(
magicbiff on github) |
magicbiff in action
WIth all the hubbub and hoohah surrounding "text-to-image" applications that use machine learning models (aside: I use the terms hubbub and hoohah affectionately. I spend far too much time generating media with GANs, diffusion models, transformers (oh my!); don't think otherwise, please) to generate high-quality images given only a text prompt as input, the phrases "text-to-image" and "image-to-text" have presented themselves to me several times recently. The terms caused me to think of ASCII and ANSI art from my BBS days and that caused me to search for online raster image to ascii conversion tools. I found there are several, but found their output lacking in the visual appeal department. For example, take this frame from the film "The Exorcist", of Regan MacNeil levitating above her bed:
example of a popular online tool
Now let's look at the output from one of the top search results by dragging that image into the file upload box of the tool at
codebeautify.org:
It isn't spectacular-looking, for sure. The image is barely recognizable without the source frame as a hint..
Another top search result.
Here is the output of the next randomly selected top search result. This time I searched for "a better image to ascii tool online" and this site (
helloacm.com) was returned.
I'm sorry to say, but this result is even worse than the last, using the same input image of Regan.
an additional online solution.
recently seen:
asciiart.club. I have added this one because it is presently the top Google result for whatever my search term was and is listed by its title which claims to be an
Online "HD" Color Image to Text Converter (emphasis on "HD" is mine.) To its credit, it also appears to run entirely in browser like my tool, and to either its credit or detriment is quite a bit more code than mine here, and another potential positive point for this one it has selectable options (which mine does not at the moment) but these options might be a con, since I suspect they are the reason the gallery of user-created images all look, well, not great as with the others mentioned avove. I'm not screenshotting, but there is the link above so you can check it out. Mayb it is actually capable of nice-looking output with the right selection of options for your input image.
And now, magicbiff, a better tool
Now that same 1400x700 image as processed by my tool at
killsignal.net
NEW!the new color version of the tool outputs an image very close to the source, even at the much lower resolution, using ascii and html/css to color the letters and the background of each letter. Additionally, I added a drop shadow to the letters of a different shade of the same hue to, well you can see the effect below.
I have zoomed in on the screenshot and pasted the magnified square in the upper left of the image below so that you can see the characters. The gray/white highlighted part is exsctly that... I selected a few lines of text to highlight them in the browser before taking the screenshot, just to make them easier to see.
Not bad, even if I say so myself.
the older (but still better than those other two) version
Now that same 1400x700 image as processed by (the original b&w version) of my img2txt tool at
killsignal.net
That's much better. But is that ASCII? Yes, it is**. Let's take a closer look
and a little more zoom:
**I suppose that technically it's outputting html, and that if copy/pasted into a plain ascii text document the css trick of eliminating the space between lines for denser coverage will be lost. Even without the css formatting, the output is improved.
magicbiff
(c) 2023 scottvr at paperclipmaximizer dot ai