Closed brubsby closed 3 years ago
notepad does not support ansi coloring. NFO readers will, however.
the colors are cool, but for my current project I am just regex removing them, so that doesn't concern me as much. (and a flag to do no ansi colors would be nice as well)
i'm mostly confused as to why it doesn't seem to use braille with these input settings. to work around it i reverse engineered that i needed these settings:
art.image({
posterize: true,
stippled: true,
background: true,
filepath: file,
threshold: 96,
width: 32,
height: 32
});
seems like just stippled: true
should work
posterize
is a special setting which outputs the color to the background and outputs braille characters to get sub-character value accuracy via braille pixels along with full flood coloring. So stippling is already happening, but in black. If I allowed default mode stippling on top of that you'd be setting foreground and background to the same color.
What is the end output effect you want?
Also almost every language has a consise strip-ansi
module available. I have recommended this module in the past for a non-ansi mode. Presently all the pixel calculations are done in color and palette reduction logic is expensive... It would be much cheaper to do this in 256 level grey (or thresholded to 2 color).
There are no docs, but you can directly access the braille output here: https://github.com/khrome/ascii-art-braille/blob/master/braille.js
There is also another slightly less detailed sub-character mode, blocks
, which may have slightly better support in text editors
Doing some work this week. Is there a feature you wanted out of this other than being able to strip ansi chars?
So after enabling ansi stripping, I finally get what the issue is in the OP. So I fixed the issue and here are some examples of the expected behavior from the upcoming changes (2.6)
art.image({
filepath: './node_modules/ascii-art-docs/Images/animal_muppet.jpg',
width: 32,
height: 32
}, function(err, result){
console.log(result);
});
art.image({
filepath: './node_modules/ascii-art-docs/Images/animal_muppet.jpg',
width: 32,
height: 32
}).strip({}, function(err, result){
console.log(result);
});
art.image({
stippled: true,
filepath: './node_modules/ascii-art-docs/Images/animal_muppet.jpg',
threshold : 128,
width: 32,
height: 32
}, function(err, result){
console.log(result);
});
art.image({
posterized: true,
stippled: 'black',
lineart: true,
blended: true,
filepath: './node_modules/ascii-art-docs/Images/animal_muppet.jpg',
threshold : 50,
width: 32,
height: 32
}, function(err, result){
console.log(result);
});
art.image({
posterized: true,
stippled: 'black',
filepath: './node_modules/ascii-art-docs/Images/animal_muppet.jpg',
threshold : 20,
width: 32,
height: 32
}, function(err, result){
console.log(result);
});
These are all slightly different in function. Thanks for catching the defect!
Changes are live.
so i have the call to ascii-art:
and when the art is logged to the console it appears like this:
and when i save to a file it gets rendered in notepad++ as:
i'm basically trying to put some stippled ascii art in a subtitle file, fwiw.
windows 10, most recent version of ascii-art on npm.