0.1.1 • Published 3 years ago

tenjify v0.1.1

Weekly downloads
2
License
MIT
Repository
-
Last release
3 years ago

tenjify

CI npm version

Convert the image to Braille.

Installation

Using yarn:

$ yarn add tenjify

Using npm:

$ npm install tenjify

Example

const { tenjify } = require("tenjify");

const text = await tenjify("./twitter.png", { width: 40, threshold: 150 });
console.log(text);

//⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣤⣶⣶⣶⣶⣦⣄⠀⠀⢀⣀⠀⠀⠀⠀⠀⠀
//⠀⠀⠀⠀⠀⠀⢠⣿⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣴⣿⣿⣿⣿⣿⣿⣿⣿⣷⣿⠟⠁⡀⠀⠀⠀⠀⠀
//⠀⠀⠀⠀⠀⠀⠸⣿⣿⣿⣦⣄⡀⠀⠀⠀⠀⠀⠀⠀⣸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀
//⠀⠀⠀⠀⠀⠀⠀⢻⣿⣿⣿⣿⣿⣷⣦⣤⣀⣀⠀⠀⣻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀
//⠀⠀⠀⠀⠀⠀⢠⣀⣙⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀
//⠀⠀⠀⠀⠀⠀⠀⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡏⠀⠀⠀⠀⠀⠀⠀⠀
//⠀⠀⠀⠀⠀⠀⠀⠈⠻⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠁⠀⠀⠀⠀⠀⠀⠀⠀
//⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣈⣽⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀
//⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
//⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠙⠛⣻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
//⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣠⣴⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
//⠀⠀⠀⠀⠀⠀⠈⠙⠻⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠿⠛⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
//⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠉⠉⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
//⠀⣤⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⡄⠀⣤⡀⠀⠀⠀⣤⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
//⠀⣿⣧⣀⣀⣀⠀⣠⡀⠀⢀⣄⠀⠀⣠⠀⢀⣄⠀⣿⣇⣀⣀⠀⣿⣄⣀⡀⠀⢀⣠⣤⣀⠀⠀⠀⣀⣀⣀⠀
//⠀⣿⡏⠉⠉⠉⠀⣿⡇⠀⢸⣿⠀⠀⣿⡇⢸⣿⠀⣿⡏⠉⠁⠀⣿⡋⠉⠁⢰⣿⣥⣤⣽⡷⠀⣾⠋⠉⠉⠀
//⠀⠙⢿⣶⣶⣶⠀⠹⢷⣶⡾⠿⣶⣶⠟⠀⢸⡿⠀⠹⢷⣶⣶⠀⠻⢷⣶⡦⠈⠻⣦⣤⣤⡄⠀⣿⠀⠀⠀⠀

Options

nametyperequireddescriptiondefault
widthnumberoptionalwidth of the text to be generated30
thresholdnumberoptionalthreshold for binarization (0-255)128
reversebooleanoptionalreverse black and whitefalse

License

MIT

0.1.1

3 years ago

0.1.0

3 years ago