Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase color depth? #31

Open
scpedicini opened this issue May 22, 2023 · 1 comment
Open

Increase color depth? #31

scpedicini opened this issue May 22, 2023 · 1 comment

Comments

@scpedicini
Copy link

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
Copy link
Owner

khrome commented Aug 2, 2023

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;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants