Sixel: Difference between revisions

No edit summary
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
Sixel ("six pixels") does not appear to have any true, up-to-date "standard". It seems to have been introduced on DEC printers, and made its first glass appearance on the VT125, though the [http://www.vt100.net/docs/vt3xx-gp/chapter14.html VT3xx] documentation gets the most play (the VT340 appears to have been the first terminal which could sensibly scroll pixel graphics). A single sixel combines a set of programmable color registers with a vertical stack of six pixels; a sixel sprite (sprixel?) is MxN pixels where N is a multiple of 6. It is probably the most widely implemented method of pixel graphics for terminal emulators ([https://sw.kovidgoyal.net/kitty/graphics-protocol.html kitty] has its own protocol, as does [http://www.asmeurer.com/iterm2-tools/images.html ITerm2]). [https://en.wikipedia.org/wiki/ReGIS ReGIS] is a similar method for vector graphics. A single horizontal strip of sixels is a "band"; a sprixel has one or more bands.
Sixel ("six pixels") does not appear to have any true, up-to-date "standard" (Thomas Dickey's [https://invisible-island.net/xterm/ctlseqs/ctlseqs.html XTerm Control Sequences] document is probably the closest thing). It seems to have been introduced on DEC printers, and made its first glass appearance on the VT125, though the [http://www.vt100.net/docs/vt3xx-gp/chapter14.html VT3xx] documentation gets the most play (the VT340 appears to have been the first terminal which could sensibly scroll pixel graphics). A single sixel combines a set of programmable color registers with a vertical stack of six pixels; a sixel sprite (sprixel?) is MxN pixels where N is a multiple of 6. It is probably the most widely implemented method of pixel graphics for terminal emulators ([https://sw.kovidgoyal.net/kitty/graphics-protocol.html kitty] has its own protocol, as does [http://www.asmeurer.com/iterm2-tools/images.html ITerm2]). [https://en.wikipedia.org/wiki/ReGIS ReGIS] is a similar method for vector graphics. A single horizontal strip of sixels is a "band"; a sprixel has one or more bands.


Sixels are specified using only printable ASCII characters, and are thus 7-bit clean.
Sixels are specified using only printable ASCII characters, and are thus 7-bit clean.
Line 25: Line 25:


Each register is specified with a type ("1" for HSL, "2" for RGB) and three components, each between 0 and 100 inclusive. Assuming 8bpc RGB, every 2.6 bits of component get squashed to 1.
Each register is specified with a type ("1" for HSL, "2" for RGB) and three components, each between 0 and 100 inclusive. Assuming 8bpc RGB, every 2.6 bits of component get squashed to 1.
The <tt>privateColorRegisters</tt> resource (default: "true") determines whether each sixel escape sequence controls its own distinct color registers, or whether they're shared by all sprixels.


==Complexifiers==
==Complexifiers==
Line 33: Line 35:


==Detecting support==
==Detecting support==
'''FIXME'''
<tt>Send Device Attributes</tt> can be used to detect Sixel support. Send <tt>CSI Ps c</tt>. If the VT220-level reply contains a '4', sixel graphics are supported.
===Detecting details===
<tt>XTSMGRAPHICS</tt> can be used to set and retrieve Sixel-related configuration, if Sixel is supported. Send <tt>CSI ? Pi ; Pa ; Pv S</tt> where
* Pi == 1, color registers
* Pi == 2, maximum geometry
* Pa == 1, read
* Pa == 2, reset to default
* Pa == 3, set to Pv
* Pa == 4, read maximum value
For color registers, the maximum value is the absolute maximum supported by the application. For geometry, the current value is affected by current window geometry in addition to configuration.


===Known support===
===Known support===
Line 46: Line 57:
* [[Notcurses]] supports sixel intermingled with standard TUI elements
* [[Notcurses]] supports sixel intermingled with standard TUI elements
* [https://github.com/saitoha/libsixel libsixel] is pretty complete
* [https://github.com/saitoha/libsixel libsixel] is pretty complete
* [[Theory and Practice of Sprixels]]
[[CATEGORY: Terminals]]