Easy Image To ASCII Converter – imgToAscii

Category: Image , Javascript | November 15, 2022
Authorvictorqribeiro
Last UpdateNovember 15, 2022
LicenseMIT
Tags
Views841 views
Easy Image To ASCII Converter – imgToAscii

imgToAscii is a pure JavaScript implementation of image-to-ASCII conversion, which allows you to convert images into ASCII art.

See Also:

How to use it:

1. Download and insert the imgToAscii.js into the document.

<script src="src/imgToAscii.js"></script>

2. Create a new imgToAscii instance and define the path to the image.

let ele = new imgToAscii('example.jpg');

3. Set the width of the image (0 to 1).

// 50%
let ele = new imgToAscii('example.jpg', 0.5);

4. Display the ASCII art on the page.

ele.display();

5. Set the background color of the ASCII art.

ele.display('#ff0000');

You Might Be Interested In:


Leave a Reply