Convert Image to ASCII Art with Node.js

By  on  

ASCII Art

There are many people out there that don't appreciate ASCII art;  we call those people "idiots".  ASCII art has been used forever and remains, in my opinion, a feat of programming and creativity.  There's a project called image-to-ascii which doesn't just create ascii art but does so from an image of your choosing.  Baller!

Assuming you've installed dependencies, outputting an image to ASCII art in the console is fairly simple:

var ImageToAscii = require('image-to-ascii');
ImageToAscii(__dirname + '/logo.png', function(err, converted) {
    console.log(err || converted);
});

Short bit of code for a cool effect.  You'll want to size the image down to less than 200px for best display and even then the ASCII output within the console looks excellent.  As I mentioned in Show Images in Console with Node.js console-png, adding graphical elements to the console can be a nice touch and enhancement from bland text!

Recent Features

  • By
    Animated 3D Flipping Menu with CSS

    CSS animations aren't just for basic fades or sliding elements anymore -- CSS animations are capable of much more.  I've showed you how you can create an exploding logo (applied with JavaScript, but all animation is CSS), an animated Photo Stack, a sweet...

  • By
    7 Essential JavaScript Functions

    I remember the early days of JavaScript where you needed a simple function for just about everything because the browser vendors implemented features differently, and not just edge features, basic features, like addEventListener and attachEvent.  Times have changed but there are still a few functions each developer should...

Incredible Demos

  • By
    Web Notifications API

    Every UI framework has the same set of widgets which have become almost essential to modern sites: modals, tooltips, button varieties, and notifications.  One problem I find is each site having their own widget colors, styles, and more -- users don't get a consistent experience.  Apparently the...

  • By
    Animated AJAX Record Deletion Using Dojo

    I'm a huge fan of WordPress' method of individual article deletion. You click the delete link, the menu item animates red, and the item disappears. Here's how to achieve that functionality with Dojo JavaScript. The PHP - Content & Header The following snippet goes at the...

Discussion

  1. Thanks for sharing this informative blog!! From your blog I have been able to get how to convert Image to ASCII Art with Node.js
    ASCII is one of the important part of programming and can’t be left behind.
    Web Development Company in Sahibabad, Ghaziabad
    http://bespokedigitalmedia.in/web-development/

  2. Wow this really brings me back. I remember when I first saw ASCII art for the first time many years ago. I tried to create my own, and what was meant to be an Owl turned out more like The Creature from the Black Lagoon! Very cool article, will definitely give this a try when I get a chance.

Wrap your code in <pre class="{language}"></pre> tags, link to a GitHub gist, JSFiddle fiddle, or CodePen pen to embed!