Jexer : |
Session captures of Jexer-style sixel output are collected here to aid terminal authors wishing to test their sixel implementation. Each capture includes the raw output and a screenshot of what the final result looks like under xterm for comparison.
The input files to Jexer used in this test are:
The test itself consists of:
java -jar jexer-test.jar
.Open
image...
and opening lady-of-shallot.png.
Open
image...
and opening lemmling_Ladybug.png.
cat cjk.txt
.CSI ? 1 0 7 0 h
).None of the images used in the test captures have transparent pixels.
Sixel supports "transparency" in the form of unspecified pixels, and this feature can be used for some really neat effects. Alas, neither img2sixel nor Imagemagick seem capable of generating transparent pixels (at least I could not figure it out). I created two sixel images with missing pixels manually, by adding the "0;1;0" options in the introducer and changing most of the black color characters to "?" within the file that can be used to test images overlapping text:
Jexer git head can also be used to create transparent sixel images, using the jexer.backend.HQSixelEncoder main() function. For example, to convert a PNG called "file.png" to a transparent sixel image called "file.six":
java -cp jexer.jar jexer.backend.HQSixelEncoder file.png > file.six
Many more sixel inputs and outputs from a real hardware terminal have been made available by hackerb9 here, and include images with transparency. The sixel output of Chafa can also generate images with transparency.
If your terminal supports an image format with PNG file support, for example WezTerm, mintty, or iTerm2, then true alpha-blending can also happen, with wonderful effect. See here for an example.
Note that replicating this screenshot also requires 24-bit RGB support in the terminal, which is how the text translucency effect is achieved.
raw capture file (69M)
zip compressed capture file (28M)
Image under xterm:
Note that replicating this screenshot also requires 24-bit RGB support in the terminal, which is how the text translucency effect is achieved.
raw capture file (91MB)
zip compressed capture file (62M)
A screenshot of xterm is not available. Below is a screenshot using
wezterm.
The following tests have caused at least eight different terminals to crash via their image support facility. The terminals were implemented in C, C++, Java, Rust, and Go.
(Note: Originally discovered by Nick Black (@dankamongmen), see CVE-2022-24130 here.)
This test sends a very large repeat counter to a sixel decoder, which may either cause an overflow and crash the terminal, or exceed memory and crash the terminal. The output is the same as this script. A well-behaved terminal should see nothing on screen.
This test attempts to allocate a massive 100000 x 100000 empty sixel image. A well-behaved terminal should discard the image, since it will clearly be larger than the available screen. In practice, images wider than 1000 pixels in either direction should be discarded, to match the behavior of xterm.
This test attempts to allocate a massive 100000 x 100000 empty PNG image. A well-behaved terminal should either discard the image or crop it to fit the screen, since it will clearly be larger than the available screen. It is not specified in the iTerm2 image protocol documentation what the terminal should actually do for a very large image.
For applications to really get the most out of your terminal's sixel or iTerm2 image support, you should also have the following features: