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!

The post Convert Image to ASCII Art with Node.js appeared first on David Walsh Blog.

Source: David Walsh