|
|
|
|
|
by Per_Bothner
1127 days ago
|
|
Sixel has the one advantage of being mplemented in xterm and a modest number of other terminals. Otherwise, it's a pretty bad format: Inefficient. Unclear and inconsistently implemented specification. All images have to be a multiple fof 6 pixel rows, which may not align with either image height or character height. Some terminal implement some other protocols, but attempts to specify a standard have failed. There are some tricky issues, such as: When does an image or part of an image get erased? Can you write text on top of an image and if so how are they aligned? What happens if you write an image on top of existing text? On top of an existing image? How does scrolling affect things? What happens to the image on window resize or zoom? Can you reliably update part of an image? DomTerm (https://domterm.org) supports images in two ways:
For sixels, it creates a canvas element as an "underlay". As it is earlier in he rendering order, following text can be written on top of the image. DomTerm also supports general HTML, including IMG elements. (Of course it is safety-scrubbed.) This is quite flexible, but it doesn't overlap regular text (without some contortions). DomTerm allows different lines to have different height, which is beneficial for "printing" an image without having to pad the output to an integral number of rows. Neither of these DomTerm protocls are suitable for a portable protocol that can be widely implemented. Two other protocols that I'm aware of are the iTerm2 protocol and the Kitty protocol. Both are bit on the complicated side, but a subset of one of those might be an acceptable "standard". |
|