Being able to use GNUPlot with Sixel output or tools like lsix[1] is really cool! I think if support / libraries / knowledge about Sixels was more widespread, we would see some really nifty terminal applications cropping up.
I was thinking about adding sixel support to this to have a universal graphics library that intelligently uses the best method available., but never got around to it yet.
It turns out because of the way sixels are encoded (six vertical pixels in a row using bitplanes) it packs better than png when used in conjunction with the bzip2 packer. Every image can simply be encoded to sixel with imagemagick using "convert image.png sixel:- > image.six"
Personally I think sixels are genius should be used much more often.
Cute! But is it fair? I don't think it's lossless - the color depth is much reduced.
Sixel + bzip2: 245K
PNG Imagemagick: 467K
PNG Zopfli 10 Iterations: 188K
XTerm.*.decTerminalID: vt340
XTerm.*.numColorRegisters: 256
And refresh with xrdb -merge $HOME/.Xresources
It should work now.Also, some terminals support the DEC SIXEL protocol² (again, I know mlterm does).
¹ https://www.iterm2.com/utilities/imgcat
² https://en.wikipedia.org/wiki/Sixel
Edit: I couldn't find a simple SIXEL sample — you'd think one of the popular sixel libraries would have some in unit tests, but no. So for the purpose of this thread (but maybe not forever, hence /tmp/),
curl https://datatravelandexperiments.com/kps/tmp/example.sixel
curl https://datatravelandexperiments.com/kps/tmp/example.osc1337
Those are such that output directly to the terminal will produce an image if that format is supported (and probably nothing if not, but I'm not making promises).Having inline plots in the terminal - especially things like histograms which just work - is often quite handy. And it just works over an ssh connection.
Also, recently, Julia changed its sparse matrix display to show a picture of the sparse matrix (spy plot) using braille characters!
julia> a = sprand(20,20,0.2)
20×20 SparseMatrixCSC{Float64,Int64} with 67 stored entries:
⠀⠀⠁⠐⠄⠋⠡⠀⠐⡀
⢳⠁⠡⠈⠂⠀⠀⠁⢡⠑
⡠⠋⢠⡀⢄⢀⢀⠄⠈⠈
⠩⠄⠐⠨⠈⠀⠆⠂⠨⠤
⠄⠄⢀⢂⠠⢀⠀⠂⠆⠂Can't safely use a touchscreen or mouse when all hell breaks loose in space!
hipsterplot: https://github.com/imh/hipsterplot
For robotics people -- the above is used in rosshow: http://github.com/dheera/rosshow