image-convert-ascii
v1.1.2
Published
convert image to ascii
Downloads
11
Maintainers
Readme
Convert Image to Ascii
convert img element to ascii
Installation
use npm
$ npm install image-convert-ascii
Syntax
new Convert(img element ID, pre element ID, width, height);
Example
pre,img element with ID in HTML
<body style="font-size: 10px">
<pre id="pre"></pre>
<!-- Insert the image want to convert -->
<img id="img" src="./asciiTest.png" crossorigin="anonymous" />
</body>
use npm
import Convert from 'image-convert-ascii';
//input img, pre element ID and size
new Convert('img', 'pre', 100, 100);
in browser
<script defer type="module">
import Convert from 'https://cdn.jsdelivr.net/gh/hoonsbory/image-convert-ascii/Convert.js';
new Convert('img', 'pre', 100, 100);
</script>