Textualize / textual

The lean application framework for Python. Build sophisticated user interfaces with a simple Python API. Run your apps in the terminal and a web browser.
https://textual.textualize.io/
MIT License
25.19k stars 772 forks source link

Add Image support using imgcat #4654

Closed AM-I-Human closed 3 months ago

AM-I-Human commented 3 months ago

I know that is on roadmap and I think I can help by suggesting this. I found this Python package that enable you to see images on the terminal. It supports Wezterm, so with it you have full resolution images. https://pypi.org/project/imgcat/

Considering that is python it's possible to take inspiration from it to make it. This can enable a full markdown previewer for the terminal, I think the neovim community will love this.

github-actions[bot] commented 3 months ago

We found the following entry in the FAQ which you may find helpful:

Feel free to close this issue if you found an answer in the FAQ. Otherwise, please give us a little time to review.

This is an automated reply, generated by FAQtory

SkwalExe commented 3 months ago

This uses Kitty's Terminal graphics protocol, which isn't supported by most terminal emulators...

AM-I-Human commented 3 months ago

I understand we must consider that only terminal emulators with rendering capabilities can render images well. (I found this discussion for windows terminal; I didn't grasp it fully but place here for reference https://github.com/microsoft/terminal/issues/5746) I found this repo that seems better https://github.com/AnonymouX47/term-image That support other images terminal using block mode: https://github.com/AnonymouX47/termvisage

AM-I-Human commented 3 months ago

I found this #384, on rich. I think it is better if I close this then.

github-actions[bot] commented 3 months ago

Don't forget to star the repository!

Follow @textualizeio for Textual updates.

nithin-mk commented 3 months ago

This uses Kitty's Terminal graphics protocol, which isn't supported by most terminal emulators...

No, imgcat uses the iTerm2 Inline Images Protocol, which is supported by many terminals, including VS Code now.