Add support in Windows Terminal for Kitty's Graphics Protocol
Description of the new feature/enhancement
Support Kitty's graphics rendering protocol. See https://sw.kovidgoyal.net/kitty/graphics-protocol.html. This would provide even more support than Sixel (but would be an additive sequence, not replacement.)
Proposed technical implementation details (optional)
https://github.com/kovidgoyal/kitty/issues/33 provides some discussion and an implementation spec.
Thanks for the request! I'd rather we not plan support for a third graphics protocol when we don't even support one.
Could it be a possible extension idea then? Though based on what I saw from the extension PR, not sure if this is something that could be extended under current spec.
@j4james Since Sixel is looking like it's not currently feasible, would Kitty's protocol be more easily adopted/implemented?
@WSLUser What makes you believe that sixel isn't feasible?
https://github.com/microsoft/terminal/issues/448#issuecomment-853424240 and also seems to be more to it here: https://github.com/hackerb9/lsix/issues/41
That doesn't sound like "not feasible" to me. That sounds like "more complicated to be fully compatible than you might think". I'm pretty sure the entire saga of PRs (e.g. #10011) that @j4james has been working on has been a long steady march towards sixel support (he can correct me if I'm wrong).
Yeah I said currently. I'm hoping for us to have at least something to use and seems like getting Sixel support will be a long way aways as we're waiting for these bugs in other terminals and Sixel applications to be resolved. Since he made it clear he's not really interested in trying to support it further at this time, I thought/hoping he may be interested in trying to support this other protocol instead, which technically is superior to Sixel anyways.
There are two issues involved here:
-
Propagating images over conpty. The conclusion I reached was that the most practical long-term solution would be a pure pass-through implementation of conpty. And this would likely be necessary for any image protocol. I'm not saying it's impossible to achieve with the current conpty implementation, but that would require buffering the images on the conhost side, and then regenerating partial image slices on the fly as the screen was updated. It's complicated, inefficient, and would probably depend on proprietary VT extensions.
Another approach would be to pass just the image protocol through directly, and hope it doesn't get erased by a subsequent refresh of the text buffer. This might work some of the time, e.g. if you're just outputting an image from the command line, but any reasonably complex application involving a mix of text and images is almost certain to break at some point.
-
The sixel image protocol itself. Personally I would like our sixel implementation to be a true emulation of the original hardware terminals, just with simple backward-compatible extensions (like support for a larger palette size, and optional per-image palettes). Most open source terminals, however, implement a format that (as Douglas Adams would describe it) is almost, but not quite, entirely unlike sixel. And the problem is that at least some modern sixel applications rely on the behaviour of these pseudo-sixel terminals.
I was hoping there might be a way we could implement the protocol that was both compatible with the original hardware, and also capable of supporting modern sixel applications, but that's not looking promising at the moment. And while I'd personally be quite happy with just a standard version of sixel, I don't think the rest of the WT userbase would necessarily agree, and our users tend to be abusive when they don't get what they want, so I'd rather avoid that fight.
So right now I'm working on point 1, since that I think is a necessity for any image protocol. On point 2, I've put the coding side of things on hold for now, but I'm still working in the background to try and nudge other terminals an apps in the right direction. And even if I don't get my way, there's no reason someone else with different priorities couldn't put together a sixel implementation that is good enough for modern usage.
As for the Kitty Graphics Protocol, I have zero interest in implementing that myself, but if someone did want to take that on, we still need to resolve point 1 first, so it's in no way a quick fix.
FWIW, gnuplot 6.x supports KGP.
@smprather FYI, gnuplot also supports Sixel, so you can already use it with the preview version of Windows Terminal.
I would love to see the Kitty protocol on the Windows Terminal.
I know Kovid can be a bit... much? (ask the tmux team; or ask me). But I gotta hand it to the guy. He's moving the ball downfield.
Now that sixel is out of preview, been wondering about kitty graphics myself as I'd like to use vv, a full-resolution, HDR capable, image viewer.
Would support be easier to implement now that the graphics pipeline seems mature?
Would support be easier to implement now that the graphics pipeline seems mature?
I'm afraid not. I did briefly look at it, but the kitty graphics protocol doesn't work anything like the standard DEC image protocols, most obviously in the way it interacts with text. The Sixel code would probably be a good starting point for implementing other DEC image protocols (e.g. ReGIS), but with kitty we'd essentially be starting from scratch - I don't think there's any overlap.
@jessey-git FYI, if you build vv yourself from the latest commit, it should now work in Windows Terminal using Sixel, at least good enough for previewing images, even if it's not pixel-perfect HDR.
Ah indeed! A tremendous thank you! I take it you may have had a hand in poking that project there. This is probably decent enough for now I suppose. At least I can view the types of files I need in an ok capacity (OpenEXR, tiff, raw).
For folks stumbling here, the vv project requires linux to build but is easy to run from the windows side of things using wsl:
wsl --exec <path to the built vv binary> <an appropriate linux path to the image file>
Any chance this would get implemented at some point or will Windows Terminal fall behind?
The Kitty protocol delivers a much better visual result on my setup compared to the Sixel protocol. Recently, while trying out pet from codex-cli, I observed a massive difference in display quality.
The top image shows Windows Terminal, and the bottom image shows WSLg + Ghostty.
Thanks for the request! I'd rather we not plan support for a third graphics protocol when we don't even support one.
I mean, I’m viewing album covers using sixel graphics. But there’s a bit of dithering because we’re limited to 256 colors here, so it looks like a 1990s gif in 2026 resolution.
I have a command line album art downloader/viewer i creaated, so my console session looks like this:
So it seems we do have graphics support now in 2026... added sometime sine that comment where you said you don’t even support one ☺
But yea. I’d love to be able to use chafa in kitty or iterm2 mode to get a more accurate render of the album cover. 256 colors looks wonky. I remember when GIF was invented....
But there’s a bit of dithering because we’re limited to 256 colors here
@ClaireCJS FWIW, it is actually possible to get more than 256 colors with sixel by layering multiple images. You can see some examples of that in the thread here: https://github.com/microsoft/terminal/issues/20020#issuecomment-4130406917.
And I'm fairly certain chafa had an open issue where this idea was discussed, so you may well see it as an option at some point in the future. I don't think there were any immediate plans for it though.