Sixel
| Industry | Computer hardware |
|---|---|
| Founded | 1957 |
| Fate | Acquired by Compaq in 1998 |
| Headquarters | Maynard, Massachusetts , United States |
| Products | Computers, terminals, printers, software |
Sixel, an abbreviation of "six pixels," is a bitmap image format created by DEC for use with terminals and printers. It represents graphics as vertical columns composed of six-pixel-high segments, each encoded as a single ASCII character. This approach facilitates straightforward transmission over 7-bit serial connections, utilizing 64 distinct patterns that correspond to printable ASCII characters.
Originally devised to transmit bitmap images to DEC dot matrix printers such as the LA50, sixel mode controlled six of the nine pins in the print head through encoded characters. Subsequently, it was repurposed for the VT200 series and VT320 terminals, enabling the definition of custom character sets, commonly called soft or dynamically redefinable character sets (DRCS). More advanced terminals including the VT240, VT241, VT330, and VT340 were capable of decoding complete sixel images for on-screen display, broadening its application beyond printing.
Description
Sixel divides bitmaps into horizontal strips each six pixels tall; every vertical column one pixel wide constitutes a sixel. Pixels are interpreted as binary values to form a 6-bit number ranging from 0 to 63, which is then offset by 63 to fit within the range of printable ASCII characters. Control codes such as carriage return (CR) and line feed (LF) are represented by and , respectively, typically sent together as .
The format incorporates a simple form of compression using run-length encoding (RLE), indicated by followed by a count and a sixel character. This method reduces data size and streamlines decoding.
Activation of "sixel mode" occurs via the escape sequence , where parameters specify settings like aspect ratio, zero-color handling, and grid dimensions. The sequence concludes with , which restores the device to its default state.
In printers, after expanding RLE sequences, sixel data directly manipulates print head pins. Terminals render sixels through the ReGIS graphics system by storing glyphs and performing efficient bit blitting operations.
When used to define custom character sets, CR/LF pairs are replaced with a single /. For instance, VT300 series terminals with 80 columns employed glyphs sized 15×12 pixels, defined through 30 sixels.
Color functionality is activated using the character followed by color register identifiers that differ depending on the device. Colors are specified in DEC’s proprietary RGB or HLS color models. For printers capable of color output, multiple bitplanes representing register-based colors are transmitted. Because of hardware variations, color sixel output is tailored for particular devices; terminals without graphics support ignore these sequences silently.
Sample
␛Pq #0;2;0;0;0#1;2;100;100;0#2;2;0;100;0 #1~~@@vv@@~~@@~~$ #2??}}GG}}??}}??- #1!14@ ␛\
This snippet initiates sixel mode, establishes three color registers, and draws sixels employing those colors. The command #0;2;0;0;0 assigns color register 0 as black using RGB values, while registers 1 and 2 are set to yellow (100%, 100%, 0%) and green (0%, 100%, 0%), respectively. Unlike standard 8-bit per channel RGB systems, this format uses percentage intensities from 0% to 100%.
The data lines select colors—yellow for the first and third lines and green for the second—and render corresponding sixels. The final line employs run-length encoding (RLE) to repeat the @ character (binary 0b100000) fourteen times, producing an output measuring 14 by 7 pixels. The $ symbol indicates overprinting on the current line, while - begins a new sixel row.
See also
- ReGIS – vector-based graphics utilized on DEC VT-series terminals
- Semigraphics – graphics formed from text, including sub-character block elements
References
- "VT330/VT340 Programmer Reference Manual, Volume 2: Graphics Programming", Digital, EK-VT3XX-GP-002, May 1988
- Chris Chiesa, Comprehensive Overview of SIXELs, 29 September 1990