Sixel
   HOME

TheInfoList



OR:

Sixel, short for "six pixels", is a
bitmap In computing, a bitmap is a mapping from some domain (for example, a range of integers) to bits. It is also called a bit array A bit array (also known as bitmask, bit map, bit set, bit string, or bit vector) is an array data structure that c ...
graphics format supported by
terminal Terminal may refer to: Computing Hardware * Terminal (electronics), a device for joining electrical circuits together * Terminal (telecommunication), a device communicating over a line * Computer terminal, a set of primary input and output dev ...
s and printers from DEC. It consists of a pattern six
pixel In digital imaging, a pixel (abbreviated px), pel, or picture element is the smallest addressable element in a raster image, or the smallest point in an all points addressable display device. In most digital display devices, pixels are the smal ...
s high and one wide, resulting in 64 possible patterns. Each possible pattern is assigned an
ASCII ASCII ( ), abbreviated from American Standard Code for Information Interchange, is a character encoding standard for electronic communication. ASCII codes represent text in computers, telecommunications equipment, and other devices. Because of ...
character, making the sixels easy to transmit on 7-bit serial links. Sixel was first introduced as a way of sending bitmap graphics to DEC
dot matrix printer A dot matrix printer is an impact printer that prints using a fixed number of pins or wires. Typically the pins or wires are arranged in one or several vertical columns. The pins strike an ink-coated ribbon and force contact between the ribbon ...
s like the LA50. After being put into "sixel mode" the following data was interpreted to directly control six of the pins in the nine-pin
print head In computing, a printer is a peripheral machine which makes a persistent representation of graphics or text, usually on paper. While most output is human-readable, bar code printers are an example of an expanded use for printers. Differ ...
. A string of sixel characters encodes a single 6-pixel high row of the image. The system was later re-used as a way to send bitmap data to the VT200 series and
VT320 The VT320 is an ANSI standard computer terminal introduced by Digital Equipment Corporation (DEC) in 1987. The VT320 is the text-only version, while the VT330 adds monochrome ReGIS, Sixel and Tektronix 4010 graphics, and the VT340 adds color. ...
terminals when defining custom
character set Character encoding is the process of assigning numbers to graphical characters, especially the written characters of human language, allowing them to be stored, transmitted, and transformed using digital computers. The numerical values that ...
s. A series of sixels are used to transfer the bitmap for each character. This feature is known as soft character sets or dynamically redefinable character sets ( DRCS). With the
VT240 VT or Vt may refer to: Businesses and organizations * Verlag Technik, a former German publishing house * VT F.C. (Vospers Thornycroft FC), a UK football club * VT Group, a British defence company * Air Tahiti (IATA airline designator VT), a Fren ...
,
VT241 VT or Vt may refer to: Businesses and organizations * Verlag Technik, a former German publishing house * VT F.C. (Vospers Thornycroft FC), a UK football club * VT Group, a British defence company * Air Tahiti (IATA airline designator VT), a Fren ...
, VT330, and VT340, the terminals could decode a complete sixel image to the screen, like those previously sent to printers.


Description

Sixel encodes images by breaking up the bitmap into a series of 6-pixel high horizontal strips. Each 1-pixel-wide vertical column in a particular strip forms a single sixel. Each sixel's pixels are read as binary and encoded into a single 6-bit number, with "on" pixels encoded as a 1. This number, from 0 to 63 decimal, is then converted into a single ASCII character, offset by 63 so that an all-black sixel, 0 decimal, is encoded as . This ensures that the sixels remain within the
printable character In ISO/IEC 646 (commonly known as ASCII) and related standards including ISO 8859 and Unicode, a graphic character is any character intended to be written, printed, or otherwise displayed in a form that can be read by humans. In other words, it i ...
range of the ASCII character set.
Carriage return A carriage return, sometimes known as a cartridge return and often shortened to CR, or return, is a control character or mechanism used to reset a device's position to the beginning of a line of text. It is closely associated with the line feed a ...
(CR) is represented by , and
line feed Newline (frequently called line ending, end of line (EOL), next line (NEL) or line break) is a control character or sequence of control characters in character encoding specifications such as ASCII, EBCDIC, Unicode, etc. This character, or a ...
s (LF) with a ; both had to be sent in turn to return the cursor to the start of the line, . Sixel also includes a rudimentary form of compression, using
run-length encoding Run-length encoding (RLE) is a form of lossless data compression in which ''runs'' of data (sequences in which the same data value occurs in many consecutive data elements) are stored as a single data value and count, rather than as the original ...
(RLE). This is accomplished with the character followed by a decimal number of the times to repeat, and then a single sixel character to be repeated. Since the and decimal digits cannot be valid sixel data, lying outside the encoded range, the encoding is easy to identify and expand back out in software. "Sixel mode" is entered by sending the sequence . The p1 through p3 were optional setup parameters, with p1 defining an aspect ratio (deprecated in favor of p3), p2 how to interpret the color of zeros, and p3 with simple grid size parameters. is the standard DEC "
Device Control String The C0 and C1 control code or control character sets define control codes for use in text by computer systems that use ASCII and derivatives of ASCII. The codes represent non-printable character, additional information about the text, such as t ...
", or DCS, which was used to turn on or off a number of special features in DEC's equipment. The "q" is the sixel identifier. Sixel data then followed the q. The "String Terminator" sequence returned the device back to normal character mode again. For printing, sixels are sent to the printer, decoded back into binary, and sent directly to six pins in the print head. The only complexity involved expanding the RLEs into the internal print buffer. Display on a terminal is somewhat more difficult. On terminals supporting graphics, the
ReGIS Regis or Régis may refer to: People * Regis (given name), a given name (including a list of people with the name) * Regis (surname), a surname (including a list of people with the name) * Regis (musician), full name Karl O'Connor, an English ...
graphics system was used to directly draw the sixel pattern into the screen's bitmap. This was done at high speed by storing the bitmap patterns as a glyph and then
blitting Bit blit (also written BITBLT, BIT BLT, BitBLT, Bit BLT, Bit Blt etc., which stands for ''bit block transfer'') is a data operation commonly used in computer graphics in which several bitmaps are combined into one using a ''boolean function''. The ...
them. When used for defining custom character sets the format was almost identical, although the escape codes changed. In terms of the data, the only major difference is the replacement of the separate CR/LF with a single /. In the VT300 series for instance, 80-column character glyphs were 15 pixels wide by 12 high, meaning that a character could be defined by sending a total of 30 sixels. Color is also supported using the character, followed by a number referring to one of a number of
color register In computer graphics, a palette is the set of available colors from which an image can be made. In some systems, the palette is fixed by the hardware design, and in others it is dynamic, typically implemented via a color lookup table (CLUT), ...
s, which varied from device to device. The colors in the registers are defined using either
RGB The RGB color model is an additive color model in which the red, green and blue primary colors of light are added together in various ways to reproduce a broad array of colors. The name of the model comes from the initials of the three addi ...
or HLS values in a peculiar DEC format. To create a color image on a printer, a line of sixels is sent several times, each representing a single bitplane from the register-based colors on the terminals (normally 2 or 4 bits). Since the capabilities of the hardware vary widely, a color sixel drawing can only be output to targeted devices. Non-graphics terminals generally silently ignore sixel escape sequences.


Sample

 Pq
 #0;2;0;0;0#1;2;100;100;0#2;2;0;100;0
 #1~~@@vv@@~~@@~~$
 #2??GG????-
 #1!14@
 \
The example above enters sixel mode, sets up three color registers, and then uses those registers to draw sixels in those colors. The #0;2;0;0;0 is interpreted as "set color register 0, use mode 2 (RGB mode), set R, G and B to 0%". This sets color 0 to black, and the following commands set register 1 to yellow (100%, 100%, 0%) and 2 to green (0%, 100%, 0%). Unlike most modern systems which assign an 8-bit value (0–255) to each color channel, RGB mode is based on "intensity" of each channel from 0% to 100%. The data lines following select a color, yellow for the first and third and green for the middle, then draw sixels. The last line shows the RLE in use, meaning "repeat @ (0b100000) 14 times". The final output is 14 pixels by 7 pixels, so the last line simply repeats 0b100000 14 times to fill the last line. $ at the end of a line means that the next line will
overprint An overprint is an additional layer of text or graphics added to the face of a postage or revenue stamp, postal stationery, banknote or ticket after it has been printed. Post offices most often use overprints for internal administrative pur ...
the current line, while - means that the next line represents a new line of sixels.


Notes


See also

*
ReGIS Regis or Régis may refer to: People * Regis (given name), a given name (including a list of people with the name) * Regis (surname), a surname (including a list of people with the name) * Regis (musician), full name Karl O'Connor, an English ...
– a means of displaying vector graphics on later DEC VT-series terminals *
Semigraphics Text-based semigraphics or pseudographics is a primitive method used in early text mode video hardware to emulate raster graphics without having to implement the logic for such a display mode. There are two different ways to accomplish the emu ...
– text-based graphics, including "squot" sub-character square blocks


References


"VT330/VT340 Programmer Reference Manual, Volume 2: Graphics Programming"
Digital, EK-VT3XX-GP-002, May 1988 *Chris Chiesa
All About SIXELs
29 September 1990


External links

* tp://ftp.invisible-island.net/shuford/terminal/sixel_graphics_news.txt "Sixel Graphic News"br>"Sixel software library""VT320 Soft Character Sets""Sixel Viewer and sample Sixel images""BMP to Sixel converter"
{{Digital Equipment Corporation Graphics file formats Digital Equipment Corporation Graphical terminals