Encode the image into a sixel control sequence and vice versa. If your terminal supports this format, then you can get a nice visualization of it.
This package, although itself complete, is probably not the most convinient way to use for normal users. Package authors that aims to support sixel for various image-like types (e.g., image, video, gif, graphic, plot, latex) are the potential targeted users of this package.
The core functionality of this package is supported by the C library libsixel.
This package exports two functions:
sixel_encodeconverts the input array into sixel format sequence.
sixel_decodeconverts the input sixel format sequence into colorant array.
Terminals that support sixel
One important thing about sixel is that not all terminals support sixel control sequence. The following is an incomplete list of terminals that support sixel.
A demo in iTerm2:
It is the client terminal that renders the image. Hence if you're using any sixel-enabled terminal (e.g., iTerm2) and connect to other servers via ssh, you still get sixel supported. Sixel is nothing special but a string sequence.
Unfortunately, there are some famous widely used advanced terminal/emulator that do not support sixel (yet):
- tmux does not support sixel.
- kitty does not support sixel; it has its own image protocol.
- Windows terminal does not support sixel
For more information, you can also read the Terminal requirements section in the libsixel repo.
Sixel.jl provides a function to test if your terminal supports it:
your terminal actually supports sixel and it returns
false, please open an issue for it.