atanunq / viu

Terminal image viewer with native support for iTerm and Kitty
MIT License
2.53k stars 56 forks source link

Quality on mac is literally unusable #30

Closed ishandutta2007 closed 4 years ago

ishandutta2007 commented 4 years ago

Not sure if I am missing something,

Installed like this: cargo install viu

then opened an image like this: viu ~/Desktop/tenor.gif

The quality is like this:

Screen Shot 2019-12-14 at 1 47 34 PM

While original gif is this

tenor

atanunq commented 4 years ago

Thank you for reporting. While I cannot test on a Mac myself, my guess would be this has to do with the terminal emulator you are using and/or how many colors does it support. Sorry I cannot be more specific, hope this helps.

ishandutta2007 commented 4 years ago

I guess you are on correct lines , maybe someone else can have more specific guidelines on how I need to customise my terminal to increase the resolution, I would request to keep the issue till then.

rparrett commented 4 years ago

Terminal.app doesn't support "true color."

It would be neat if viu could detect this, do color quantization and output ansi256.

ishandutta2007 commented 4 years ago

color quantization and output ansi256

sorry if I am acting too naive, I didn't quite get it, can you explain in code ?

rparrett commented 4 years ago

Apologies for not explaining well. I'm not an expert on the matter.

Unfortunately the only thing we can do as Terminal.app users is to use a different terminal emulator that supports true color, such as iTerm2.

This gist explains the situation better than I could: https://gist.github.com/XVilka/8346728

And I happened upon this crate that converts 24-bit rgb "true color" to "ansi256" which may or may not be useful to the author.

https://docs.rs/ansi_colours/1.0.1/ansi_colours

atanunq commented 4 years ago

Hello, all! Sorry for the very delayed response.

In branch ansi256-support I added a check to make sure truecolor is available before using it. This should hopefully fix the issues on Mac and other platforms where only 256 colors are supported.

It appeared to be working on the Mac I used but could use a few beta testers, if you don't mind, before releasing it.

Tagging @CaspianA1 because it might also be related to #33. And if not, I will have another look.

CaspianA1 commented 4 years ago

I'll check it out. Thanks!

On Mon, Mar 9, 2020 at 4:16 PM Atanas Yankov notifications@github.com wrote:

Hello, all! Sorry for the very delayed response.

In branch ansi256-support https://github.com/atanunq/viu/tree/ansi256-support I added a check to make sure truecolor is available before using it. This should hopefully fix the issues on Mac and other platforms where only 256 colors are supported.

It appeared to be working on the Mac I used but could use a few beta testers, if you don't mind, before releasing it.

Tagging @CaspianA1 https://github.com/CaspianA1 because it might also be related to #33 https://github.com/atanunq/viu/issues/33. And if not, I will have another look.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/atanunq/viu/issues/30?email_source=notifications&email_token=AKADDOJY4N5GHWVGLO6ULQLRGVFAFA5CNFSM4J2ZKVB2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEOI4XCQ#issuecomment-596757386, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKADDONRAUKYVOFMUVFNUC3RGVFAFANCNFSM4J2ZKVBQ .

rparrett commented 4 years ago

Working great now. Thanks!