Hacker News new | past | comments | ask | show | jobs | submit login

I recently found out that XTerm supports sixels natively if started with the "-ti 340" option. For example gnuplot can make use of that feature using the command "set terminal sixlegd".

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.




Sixels will be added to libvte (gnome-terminal): https://gitlab.gnome.org/GNOME/vte/-/issues/254


Great news! I think we may finally see a resurgence. It will be well supported on mainstream Linux, and given that the web is getting so heavy-weight, this will offer a solid alternative for graphics that you can rely on. Libvte is very popular.


GNUPlot and XTerm also support Tektronix, there's lots of info in this older discussion.

https://news.ycombinator.com/item?id=7776904


The Kitty terminal author also published a "terminal graphics protocol". I don't know what other terminal supports it, however.

https://sw.kovidgoyal.net/kitty/graphics-protocol.html


>it packs better than png when used in conjunction with the bzip2 packer.

Cute! But is it fair? I don't think it's lossless - the color depth is much reduced.


I took the reduced color depth into consideration. However on second glance it seems like Imagemagick does not compress PNG very efficiently with default settings. After recompressing with zopflipng PNG was easily able to beat bzip2 packed sixels. Results for 256 color 512x512 Lenna:

Sixel + bzip2: 245K

PNG Imagemagick: 467K

PNG Zopfli 10 Iterations: 188K


I used your ImageMagick command, but the resulting image is very bright and almost invisible. I tried disabling Unicode using +u8, but that didn't work. I tried mlterm, that worked.


I forgot to tell that you have to enable 256 colors as well. Put this into your .Xresources:

    XTerm.*.decTerminalID: vt340
    XTerm.*.numColorRegisters: 256
And refresh with

    xrdb -merge $HOME/.Xresources
It should work now.


That should be "sixelgd", of course. And there is the classic "dumb" terminal, that plots to any text terminal, optionally using ansi escape codes for color.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: