Giter Club home page Giter Club logo

img2txt's Introduction

img2txt

A fork of hit9/img2txt, implemented in node.js But now PNG only

Image to Ascii Text. Dead simple, something useless.

Just a toy

DEMO's

The following picture: foo.jpg (230x354)

  1. img2txt foo.jpg > 1.html

  2. img2txt foo.jpg > 2.html

  3. img2txt foo.jpg --nocolor > 3.html

Installation

$ npm install -g img2txt

As a CLI tool โšก

Usage: img2txt <imgfile> [--nocolor] [--nohtml] [--fontSize=<fontSize>]

sample usage:

img2txt me.png > me.html
img2txt me.png --nocolor --nohtml

the optional arguments:

--nocolor            if in color, default: false
--nohtml            if in html, default: false
--fontSize           the font-size(px) of text in the html, default: 12

Programmatical Usage: ๐Ÿ‘

var img2txt = require('img2txt');

img2txt('myAwesomeImg.png', {
  fontSize: 12,
  nocolor: false,
  nohtml: false
}, function(err, ret) {
  if (err) throw err
  process.stdout.write(ret)
})

Warning โš ๏ธ

Use browsers to look colored html may cause a big memory usage.

WhyHTML

Because it looks good in html.

License

BSD, short and sweet. :trollface::

img2txt's People

Contributors

fritx avatar hit9 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.