IonicaBizau / image-to-ascii

:floppy_disk: A Node.js module that converts images to ASCII art.
http://ionicabizau.net/blog/16
MIT License
1.58k stars 105 forks source link

Difference between image-to-ascii and cli? #36

Closed hansanghoon closed 8 years ago

hansanghoon commented 8 years ago

dsc08890

Hi, I tried to convert above image using image-to-ascii and image-to-ascii-cli.

my code is as below.

const imageToAscii = require("image-to-ascii");
const pxs = ".`:,;'_^\"\\></-!~=)(|j?}{ ][ti+l7v1%yrfcJ32uIC$zwo96sngaT5qpkYVOL40&mG8*xhedbZUSAQ
PFDXWK#RNEHBM@";

imageToAscii("DSC08890.JPG",
  {pixels:pxs},
  (err, converted) => { console.log(err || converted); }
);

results are

screen shot 2016-06-03 at 4 49 15 pm

Would you let me know how can I produce ascii image like image-to-ascii-cli using image-to-ascii? What options do I need? Thanks.

IonicaBizau commented 8 years ago

What terminal emulator are you using? It looks like the color support is not correctly detected, but you can enforce it by using: node your-script.js --color=256

More info: https://github.com/chalk/supports-color#info

IonicaBizau commented 8 years ago

The cli is using an older version of the module. 🔥

hansanghoon commented 8 years ago

screen shot 2016-06-03 at 5 06 13 pm

--color=256 works! Thanks. My mac terminal profile says Declare terminal as: ansi

IonicaBizau commented 8 years ago

@hansanghoon Ah, change that to xterm-256color. You will get 256 colors. ✨

hansanghoon commented 8 years ago

Got it. Thanks for quick response to my question 👍 😄

IonicaBizau commented 8 years ago

Great! Have fun using this module! 😁

On 03 Jun 2016, at 11:13, Han, Sanghoon notifications@github.com wrote:

Got it. Thanks for quick response to my question 👍 😄

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/IonicaBizau/image-to-ascii/issues/36#issuecomment-223517958, or mute the thread https://github.com/notifications/unsubscribe/ACu08yn4K7E_60BYdOKKVKY11UEe-Exsks5qH-ISgaJpZM4ItShY.