image-convert-ascii

1.1.2 • Public • Published

Convert Image to Ascii

convert img element to ascii
screenshot

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>

Package Sidebar

Install

npm i image-convert-ascii

Weekly Downloads

6

Version

1.1.2

License

ISC

Unpacked Size

4 kB

Total Files

3

Last publish

Collaborators

  • tonymkcv