Live data from Hacker News

Unicode-based scientific plotting for working in the terminal

github.com

1–10 of 37 posts

Re: Unicode-based scientific plotting for working in the terminal

#2
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.

Re: Unicode-based scientific plotting for working in the terminal

#3
post #2

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 usi…

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

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

Re: Unicode-based scientific plotting for working in the terminal

#4
post #2

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 usi…

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

Re: Unicode-based scientific plotting for working in the terminal

#5
post #2

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 usi…

>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.

Re: Unicode-based scientific plotting for working in the terminal

#8
post #5
post #2

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 usi…

>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

Re: Unicode-based scientific plotting for working in the terminal

#9
post #2

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 usi…

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