Sixel: Difference between revisions
| Line 8: | Line 8: | ||
Before emitting a sprixel, the terminal must first be put into the appropriate mode via "\ePq" ('''FIXME''' details on 8-bit, start params). Properly exit the mode with "\e\\" ('''FIXME''' again 8-bit). '''FIXME what about \e[?80h?''' | Before emitting a sprixel, the terminal must first be put into the appropriate mode via "\ePq" ('''FIXME''' details on 8-bit, start params). Properly exit the mode with "\e\\" ('''FIXME''' again 8-bit). '''FIXME what about \e[?80h?''' | ||
Color registers precede the band data 'en bloc'. Each color register takes the form "#N;T;a;b;c" where N is the register and T is the type (see below). | Color registers precede the band data ''en bloc''. Each color register takes the form "#N;T;a;b;c" where N is the register and T is the type (see below). | ||
Bands are separated by hyphens ('-'). Return to the start of a band without moving to the next one (i.e. to draw another color) with '$'. The same number of sixels ought be provided for each color used in a band (but they may of course be the empty sixel). For each sixel, determine which of the six pixels 0..5 (0 on the top, 5 on the bottom) match the color, and and for each pixel N, add 2ⁿ. The result will be between 0 and 63, inclusive. Add 63 to this total; the sixel is the corresponding ASCII character (between 63 and 126, inclusive). When a sixel is repeated four or more times in a row, use "!n" to runlength encode the series. | Bands are separated by hyphens ('-'). Return to the start of a band without moving to the next one (i.e. to draw another color) with '$'. The same number of sixels ought be provided for each color used in a band (but they may of course be the empty sixel). For each sixel, determine which of the six pixels 0..5 (0 on the top, 5 on the bottom) match the color, and and for each pixel N, add 2ⁿ. The result will be between 0 and 63, inclusive. Add 63 to this total; the sixel is the corresponding ASCII character (between 63 and 126, inclusive). When a sixel is repeated four or more times in a row, use "!n" to runlength encode the series. | ||