Skip to content

hoonsbory/image-convert-ascii

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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>

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published