Sixel Graphics

WARNING: this page is under construction

What are sixel graphics?

👉 Did you know:

You can display actual bitmap images on the actual console in selected terminal emulators.

https://en.wikipedia.org/wiki/VT340

Observe:

graphical 'this is fine' meme in an xterm

How can I display sixel graphics?

First you need a sixel-capable terminal emulator

XTerm supports this, but needs a little nudging to enable: ``` $ xterm -xrm "XTermdecTerminalID: vt340" -xrm "XTermnumColorRegisters: 256" ``` But do you a favor and run the following: ``` $ echo "XTerm*decTerminalID: vt340" >> $HOME/.Xresources $ echo "XTerm*numColorRegisters: 256" >> $HOME/.Xresources $ echo "XTerm*disallowedWindowOps: 1,2,3,4,5,6,7,8,9,11,13,19,20,21,GetSelection,SetSelection,SetWinLines,SetXprop" >> $HOME/.Xresources $ xrdb $HOME/.Xresources ``` And all your XTerm sessions will have 256-color sixel graphics enabled by default.

(The third line sets up some exceptions so we're allowed to query XTerm about its active screen size in pixels, from which we can then calculate the character cell size, which is kind of important to know when you want to align sixel graphics with text. Other terminal emulators already allow this by default.)

The only other sixel-capable X terminal emulator offered by Debian Buster is mlterm. No special options are needed to enable sixel graphics.

See the libsixel home page for other sixel-capable terminal emulators, including ones for the framebuffer console.

Then you need some sixel graphics

Gallery

population.awk: Screenshot of population.awk horigraph.awk: Screenshot of horigraph.awk population-bitmap.awk (v1): Screenshot of population-bitmap.awk population-bitmap.awk (v2): Screenshot of population-bitmap.awk bifur-bitmap.awk: Screenshot of bifur-bitmap.awk text-test.sixel: Screenshot of text-test.sixel mandelbrot-bitmap.awk showing the full mandelbrot set: mandelbrot-bitmap.awk showing the full mandelbrot set mandelbrot-bitmap.awk - usage - zooming in: mandelbrot-bitmap.awk - usage - zooming in

mandelbrot-bitmap.awk showing a zoomed-in view of the mandelbrot set:

mandelbrot-bitmap.awk showing a zoomed-in view of the mandelbrot set

sixkcd.bash black-on-white:

Screenshot of sixkcd.bash showing xkcd comic 2154, black-on-white

sixkcd.bash white-on-black:

Screenshot of sixkcd.bash showing xkcd comic 2154, white-on-black

Resources

Supplemental Resources