khrome/ascii-art

Increase color depth?

scpedicini opened this issue · 1 comments

Is there a functional difference between this lib and ascii-art-image?

I got ascii-art-image working, although the color palette is.... pretty bad on iTerm2 and I can't get it to display a better looking image unfortunately for a passed in RGB png file:

    var image = new Image({
        filepath: '/users/admin/images/candle.png',
        alphabet: 'blocks',
    });

    image.write(function(err, rendered){
        console.log(rendered);
    })

Original:
image

Output:
CleanShot 2023-05-22 at 16 23 10@2x

khrome commented

The color palette defaults to 4bit color (16 colors) you'll need to change your color depth to get more colors

If you want 256 coors:

var Color = require('ascii-art-ansi/colors');
Color.is256 = true;

If you want millions of colors:

var Color = require('ascii-art-ansi/colors');
Color.isTrueColor = true;