Giter VIP home page Giter VIP logo

imaging's Introduction

imaging

travis-ci npm version Dependency Status

Drawing image in your terminal whithout node-canvas,and the outputing image is more clear than using picture-tube.

Imaging, let your terminal outputs more interesting.

imaing

Installing

For node with npm:

windows

npm install imaging -g

Mac/Linux

sudo npm install imaging -g

Node.js Module

npm install imaging --save

Usage

Command line:

imaging https://www.google.com.hk/images/srpr/logo11w.png

Using piping:

echo 'https://www.google.com.hk/images/srpr/logo11w.png' | imaging

options

Set image width

imaging example.png -w 20
## or
imaging example.png --width 20

Set offset left

imaging example.png -l 20
## or
imaging example.png --left 20

imaging left

custom pixel char

imaging example.png -c @
## or
imaging example.png --char #
## if error or don't take effect, try wrapping the char with ""
imaging example.png -c "*"

imaging char names:

  • charmap specific color with specific char, enjoy it.
  • square "▇"
  • circle "●"
  • rectangle" "█"

imaging example.png -c square equal imaging example.png -c ▇

imaing char

Nodejs module

var imaging = require('imaging');
imaging.draw('example.jpg', function (resp, status) {
    /*
      if status == 'success', resp is the image charater string.
      conols.log(resp) to render the image in your terminal
      else if if status == 'fail', resp is the error message
    */
    console.log(status);
    console.log(resp);
});

// limit the width for rendering
imaging.draw('example.jpg', { width: 50}, function (resp, status) {
    /*
      if status == 'success', resp is the image charater string.
      conols.log(resp) to render the image in your terminal
      else if if status == 'fail', resp is the error message
    */
    (status == 'success') && console.log(resp);
});

API

imaging.draw(path, [options], callback) //path could be a remote link or local resource

options: object

  • width - the width of image for rendering
  • left - set the left offset of image
  • char - set the char as pixel of rendered image

callback: function (resp, status)

  • status == "fail" - resp: error msg
  • status == "success" - resp:imaging string in color format

Example

Source image:

source img

Draw into terminal:

imaging render

Support

Now, it dosn't support rendering images with batch processing. So when you want to render multiple images, only the way to imaging image for each.

imaging's People

Contributors

a0viedo avatar mudcube avatar switer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

imaging's Issues

Support local and/or piping images

I don't have a use case for a command-line tool that can render images from a remote url. I do, however, have a use case for rendering images on my local file system.

Can you add support for that?

https urls are not working

I tried to execute this

$ imaging https://www.clever-cloud.com/blog/img/medias/npm.png

and an error occurred: Running error, please check the image URI!

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.