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 the TTY's visual density #137

Open
chrisportela opened this issue Jul 16, 2018 · 8 comments
Open

Increase the TTY's visual density #137

chrisportela opened this issue Jul 16, 2018 · 8 comments
Labels
low priority question tty-mode Relates to the terminal TTY client

Comments

@chrisportela
Copy link

In browsh the images are pretty hard to distinguish sometimes. I was wondering what you thought of using something like https://github.com/daleroberts/tv as inspiration to design a more powerful image renderer?

In #86 I saw you did not want to move away from text which I believe tv does and helps here since it's goal was viewing 3gb+ images files over a terminal quickly and efficiently. He also created an iTerm specific version called bv which may be relevant to #135

No specific request here since I know you're trying to manage the complexity here, but I just knew he'd suggested his projects in the HN thread and wasn't sure if you'd been made aware of them yet since others are wondering about ways to make the images easier to view.

@tombh
Copy link
Member

tombh commented Jul 19, 2018

Thanks for bringing this to my attention. I had actually seen this before. Also my last job was working with huge map tiles, so I very much appreciate the significance of @daleroberts' work. I'd integrate it in a instant if it was written in Go.

His work ekes out a little more visual density than my UTF-8 half block trick by using a greater set of UTF-8 chars, I'd absolutely incorporate that method into Browsh. However, I don't feel it would be as big a return on investment as implementing the magnifying glass feature #33. Browsh's graphics are merely for visual cues, they simply can't be relied upon for anything else. As such any improvements that Browsh makes to its unmagnified graphics, short of implementing true high res pixels, is going to be subjective and largely academic. Whereas the magnifying glass actually has the potential to open up new abilities, like solving captchas.

@tombh tombh changed the title Use something similar to dalerobert/tv for rendering low-res images Increase the TTY's visual density Jul 20, 2018
@tombh tombh added tty-mode Relates to the terminal TTY client and removed duplicate labels Jul 20, 2018
@ArniDagur
Copy link
Contributor

ArniDagur commented Sep 1, 2018

This feature is definitely near the top of my wishlist for this project, however, I have one concern. The Python implementation of daleroberts/tv is slow; displaying a simple image can take seconds, and although Go is faster than Python, I worry that rendering on the CPU using any language is going to be kind of slow.

Although I'm no expert on this topic, I suspect one could use computing shaders like those offered by Vulkan to render using the GPU, that is, creating an array of characters and colours for each terminal cell based on image data. I have been attempting to reimplement daleroberts/tv in Rust using vulkano-rs/vulkano as a proof of concept, but the learning curve is kind of steep for me.

If any GLSL/GPU computing person could give me their thoughts on the feasibility of this idea and/or implementation advice, it would be very much appreciated by me.

@Noskcaj19
Copy link

I have actually written an image viewer using the same unicode block technique in Rust Noskcaj19/term-image and may be able to help. It isn't GPU accelerated, however parallelism or SIMD may be possible. However the output speed is limited by the terminal emulator speed, not the program itself.

@tobimensch
Copy link
Collaborator

@Noskcaj19
I'm looking forward to your pull request. :D Welcome!

@niutech
Copy link
Contributor

niutech commented Nov 10, 2020

Sixel has an implementation in Golang: go-sixel. Is it possible to include an optional Sixel mode, which renders images using it?

@tombh
Copy link
Member

tombh commented Nov 10, 2020

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.

@niutech
Copy link
Contributor

niutech commented Nov 10, 2020

That's really cool! Will it emulate terminal in a browser, like e.g. Xterm.js?
But still the issue is resolution. If you want to see images in details (like a CAPTCHA), would't it be good to temporarily switch to the Sixel mode just to see the images (possibly in the new tab)?

@tombh
Copy link
Member

tombh commented Nov 10, 2020

The whole reason I built Browsh was for low bandwidth internet. So I want the browser client to be as absolutely minimal as possible, I think terminal emulation will be too much.

I think #33 with the idea of a magnifying glass is the approach I'll take to solving issues like with CAPTCHA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
low priority question tty-mode Relates to the terminal TTY client
Projects
None yet
Development

No branches or pull requests

6 participants