browsh-org / browsh

A fully-modern text-based browser, rendering to TTY and browsers
https://www.brow.sh
GNU Lesser General Public License v2.1
16.92k stars 411 forks source link

Possibly way to increase resolution by combining fore- and background colors? #349

Open LevitatingBusinessMan opened 3 years ago

LevitatingBusinessMan commented 3 years ago

I saw this issue: https://github.com/trashhalo/imgcat/issues/3

And I wasn't sure if browsh utilized this trick yet.

tombh commented 3 years ago

Nice. I haven't seen that particular method before. Browsh does use the UTF8 half black trick, so we do get 2 colours per TTY cell, I'd be interested to see the difference between this approach and imgcat's approach

ejo0003 commented 3 years ago

Even greater quality can be achieved with an implementation that uses the full set of UTF8 block chars, as seen in https://github.com/daleroberts/tv/.

Additionally, Unicode 13 added a whole suite of legacy pseudographics characters in March 2020 that could be incredibly useful for this application (https://www.unicode.org/charts/PDF/U1FB00.pdf), but unfortunately the new characters aren't widely supported yet. I am eagerly awaiting the day they're widely adopted, characters U+1FB3C through U+1FB9F are particularly promising.

For now, in my opinion, the best implementation with UTF8 characters is going to look something like Dale Robert's tv (linked at the top).

Of course, you could use sixels to increase the resolution 9 to 1 over the current half block implementation, but they're less widely supported and use an indexed color scheme, so it's probably not worth the tradeoff. Perhaps an option to toggle sixel graphics is worth looking into in the future, however?

tombh commented 3 years ago

Cool, I didn't know that about the new chars in Unicode 13!

I don't want to support sixel. I want to remain true to Browsh's ability to render everything in pure text. Ultimately I want to develop a client in the browser, so you don't even need a terminal to benefit from Browsh.