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

Display graphical images in terminal #5746

Open
JekRock opened this issue May 5, 2020 · 28 comments
Open

Display graphical images in terminal #5746

JekRock opened this issue May 5, 2020 · 28 comments
Labels
Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Help Wanted We encourage anyone to jump in on these. Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Product-Terminal The new Windows Terminal.
Milestone

Comments

@JekRock
Copy link

JekRock commented May 5, 2020

Description of the new feature/enhancement

It would be nice to have the ability to display graphical images in the terminal by using the API provided by the Windows Terminal. Maybe something similar to https://sw.kovidgoyal.net/kitty/kittens/icat.html or https://www.iterm2.com/documentation-images.html

@JekRock JekRock added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label May 5, 2020
@ghost ghost added Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels May 5, 2020
@zadjii-msft
Copy link
Member

So we've already got #448 for display images with sixel graphics, though maybe this issue would make sense to leave open for supporting other binary image formats in the Terminal. Especially for something like gifs, which I don't think sixel is necessarily well suited for.

@zadjii-msft zadjii-msft added Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Product-Terminal The new Windows Terminal. labels May 5, 2020
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label May 5, 2020
@zadjii-msft zadjii-msft added this to the Terminal Backlog milestone May 5, 2020
@DHowett-MSFT DHowett-MSFT removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label May 11, 2020
@DHowett-MSFT
Copy link
Contributor

I'm taking triage off this. It needs a spec, and we need to make sure that we follow the prevailing standards if we're ever going to do this.

@DHowett-MSFT
Copy link
Contributor

Comments from #4544.

from @zyy1998

Display images in terminal

I'm trying to use WSL to substitute some functions on windows, it performed well in some text-only functions. But I'm also want to use ranger ( a linux terminal file explorer ) to replace totalcommander which I often used or even windows file explorer, ranger satisfies my content in many occasions but for image preview.

w3m is a terminal web browser that could be used to display images in terminal, and it can also be used by ranger. However, w3m didn't work on this terminal.

There are many other terminals like iTerm2urxvt and alacritty could display images. As a terminal under windows, I think it's more necessary to support this feature.

Proposed technical implementation details

I don't know how does w3m works, but I have noticed that the terminal could be changed the background pictures, so if you want to render some images, you can just change the specific area of the background of the terminal. Actually it's how urxvt handled it.

Of course, you don't have to support w3m, just do something that could display images correctly and the method could be called by other apps like ranger, that's all what I need.

Thanks! ( And pardon for my poor English😁 )

You can find more information here: https://github.com/ranger/ranger/wiki/Image-Previews

from @akho

w3m and überzug both rely on x11 to draw an image in a subwindow. It is highly unlikely that either of the two can be made to work in Terminal without also modifying the tools themselves.

Having some way to draw images in terminal would be very nice though. Kitty, for example, implements its own thing (icat), and integrates well with ranger. Would be lovely to have that in Terminal.

Sixel or whatever iTerm2 does are also nice, I think Sixel support is in the pipeline? Not supported by ranger yet, though.

@remkop
Copy link

remkop commented May 19, 2020

This discussion between the authors of various terminal emulators may be relevant: https://gitlab.freedesktop.org/terminal-wg/specifications/issues/12

It looks like MinTTY went ahead and implemented iTerm2 escape sequences so perhaps this is worth considering as a de facto standard.

@egmontkob
Copy link

See also https://gitlab.freedesktop.org/terminal-wg/specifications/-/issues/26.

@j4james
Copy link
Collaborator

j4james commented May 31, 2020

See also https://gitlab.freedesktop.org/terminal-wg/specifications/-/issues/26.

https://xkcd.com/927/

@dotnetCarpenter
Copy link
Contributor

I tried to use feh in terminal but I needed X11 running. So I tried both VcXsrv Windows X Server and MobaXterm Home Edition. In both cases, I need to forward to X11 and open Windows firewall TCP port 6000 as described on StackOverflow.

But both also had a lot more than I need or want. And both will only display images in their own terminal. I want to use Microsoft terminal and I want images to look like the mockup at wslutiliti.es (using feh).

I googled how to run X11 server in MS terminal and found this issue... I hope it's feasible. 🤷

@metawrap-dev

This comment has been minimized.

@zadjii-msft

This comment has been minimized.

@sintaxx

This comment has been minimized.

@DHowett
Copy link
Member

DHowett commented Aug 25, 2020

no. If you'd like updates, click on the subscribe button to the right.
As long as this issue is open and there have been no comments indicating progress, you can reasonably expect that there hasn't been any progress.

@JekRock
Copy link
Author

JekRock commented Aug 29, 2020

Here is an interesting project about rendering videos in a terminal https://github.com/ghaiklor/terminal-canvas

@dinhanhx
Copy link

Here is the closest thing I found https://github.com/nabijaczleweli/termimage

@MuizU
Copy link

MuizU commented Feb 12, 2021

Has anyone had any success using ueberzug?

@dinhanhx
Copy link

Has anyone had any success using ueberzug?

#4544 (comment)

@bushnerd
Copy link

Has anyone had any success using ueberzug?

I test it, it did not work.

@zacknorman
Copy link

Just wanted to chime in as I'm excited for this... specifically being able to properly run neofetch with w3m wallpaper support...

If it's any help, I think the escape sequence in iTerm2 would be the best case. I've always used that on MacOS and it's exceptional. Another one worth looking into might be tycat from the terminology terminal in enlightenment.

Looking forward to seeing this happen - and honestly - I'd love to help out with it.

@hhoeflin
Copy link

Here another very good program for converting images to something that can be displayed in terminal with a lot of different options.

https://github.com/hpjansson/chafa

@bragmore

This comment was marked as spam.

@christianparpart
Copy link

christianparpart commented Sep 19, 2021

why is there no support for this yet?

Because it's complicated.

Because ConPTY needs to support that (e.g. via VT passthrough) first before any other terminal on windows can display images generically.

Best chances are to get it via #1173 .

@zadjii-msft zadjii-msft modified the milestones: Terminal Backlog, Backlog Jan 4, 2022
@danielbisar

This comment was marked as off-topic.

@koszeggy
Copy link

koszeggy commented Dec 17, 2022

Apart from some well-supported future API for this, it would be nice if at least the legacy solutions were not broken. It has been working since Windows XP until Windows 10 and even ConEmu emulates this behavior. And a sort of popular console apps such as Far Manager could utilize it in some clever ways:
Image in pre-Windows 11 console window

Unfortunately this no longer works with Windows 11 Terminal. I don't know what's missing to make it work again because GetConsoleWindow still returns the console handle as a Win32 HWND and even the Graphics::FromHWND method returns a seemingly valid instance, it's just its VisibleClipBounds is always an empty rectangle.

@odell0111
Copy link

odell0111 commented Oct 13, 2023

The Python package, image-in-terminal, performs well by replacing every two pixels of an image with the character ▀ (Upper Half Block). This makes it most suitable for displaying low-resolution images. While images with higher resolutions can also be displayed in the terminal, performance may decrease and the terminal’s contents will need to be zoomed out to view the images. This package served my small project well, and it might also be useful for others until the Windows Terminal implements support for displaying images

@evanjs evanjs mentioned this issue Nov 2, 2023
56 tasks
@Shailosingh
Copy link

Hey! I recently have been using Windows Terminal to SSH into a Linux VM and found out that there is functionality within neofetch to change the ASCII image to a real image (I know I'm late). However, it wasn't working on my Windows Terminal so I googled and found this issue page.

I notice that it is very old so I have some questions:

  1. Is this still a feature being considered? Does the team consider rendering images within the Terminal a priority?
  2. I am pretty sure most people would want this for WSL but, if this feature got finished, is there a chance it would work when Linux is open via SSH (like in my case)?

@lhecker
Copy link
Member

lhecker commented Nov 3, 2023

Yes, to both questions. An initial implementation would almost certainly implement sixels first, since we already have a basic sixel parser (and related code) and it's the most basic of format. And sixels work over SSH. (Edit: And the linked formats both support SSH as well.)

@Shailosingh
Copy link

Yes, to both questions. An initial implementation would almost certainly implement sixels first, since we already have a basic sixel parser (and related code) and it's the most basic of format. And sixels work over SSH. (Edit: And the linked formats both support SSH as well.)

Oh wow, that's great! Thanks for the update!

@iSeiryu
Copy link

iSeiryu commented Feb 13, 2024

why is there no support for this yet?

Because it's complicated.

Because ConPTY needs to support that (e.g. via VT passthrough) first before any other terminal on windows can display images generically.

Best chances are to get it via #1173 .

#1173 (comment)
Windows Terminal Preview has a hidden setting for this now:

"experimental.connection.passthroughMode": true,

@trackd
Copy link

trackd commented Nov 22, 2024

having spent a fair amount of time playing around with the different Image protocols in Sixel Module

which supports Sixel and experimental support for IIP and Kitty Graphics.

I really wish WT implemented Kitty Graphics Protocol

Using the image binary data like InlineImageProtocol and Kitty does is just way easier and faster.

And kitty gives you alot of control on how to render, position, animation and supports compression etc.

Sixel is really cool but feels kinda inefficient in comparison.

@lhecker lhecker added the Help Wanted We encourage anyone to jump in on these. label Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Help Wanted We encourage anyone to jump in on these. Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Product-Terminal The new Windows Terminal.
Projects
None yet
Development

No branches or pull requests