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

Super neat. If you want to go even deeper down the terminal graphics rabbit hole you should look into adding sixel support.

https://github.com/saitoha/libsixel




And for terminals that don't support sixel yet, sixel-tmux will let you see them:

http://github.com/csdvrx/sixel-tmux

For example with Windows Terminal: https://raw.githubusercontent.com/csdvrx/sixel-tmux/main/exa...

OP, if you want to keep your current solution, check how going beyond unicode halfblocks can help: https://github.com/csdvrx/derasterize


This is really cool. Is it supported on the framebuffer terminal as well?


sixel-tmux works literally anywhere you can use tmux: as long you can display unicodes on your terminal, the sixels will be "captured" by sixel-tmux and converted into something you can see. Sixels are in-band, so ssh isn't a problem.

In a way, using sixel-tmux is like "giving magical goggles" to your terminal, to let it render sixels so you can see something (even if it isn't perfect), in the hope you'll be tempted to use a better terminal that will show you sixels in all their glory, with a pixel perfect quality.

Sixels enable all kind of cool things, like gnuplot right in your terminal (cf https://github.com/csdvrx/sixel-gnuplot ): sometimes I even watch youtube on my terminal lol

sixel-tmux was made as a first step towards turning derasterize into a more general library: my plan was to add it to nnn but I got bored along the way and moved to other stuff. I might still do that I I love nnn as a filemanager.

BTW, even if there have been quite a few interesting work by @hpa and others in the last 2 years, I think derasterize still has textmode supremacy. derasterize is a collab with @jart after I started adding features to her previous solutions which was based on half blocks like this solution; she's also made further work based on this like https://justine.lol/printimage.html and https://justine.lol/printvideo.html


> as long you can display unicodes

On Linux, virtual terminals are currently limited to 512 glyphs and 16 colors. You can't do much graphics with that, unless you bypass the terminal layer and write directly to the framebuffer, like w3mimg does.


VT's but not XTerms. Also, framebuffer based VT's allow 256 colors with ease.

On the font issue, yes, sadly you are right. It's retarded to just have 512 glyphs on a framebuffer, not a true tty. The framebuffer or KMS should support TTF fonts by default. A Unifont TTF would be godsend here.


Since Linux v3.16, the vt driver recognizes 256-color and even 24-bit escape sequences, but it maps the colors to the 16-color palette:

https://git.kernel.org/linus/cec5b2a97a11ade5


I should have been clearer: as long as you have a font which has entries for the glyphs used by derasterize and sixel-tmux - check the source and you'll see you don't need a lot of them.


Oh wow, I was going to ask about the one PDP-11 terminal we had in the 1980s with graphics support.

I only had a vague memory it was huge, expensive and got very warm but in the 1980s there weren't any graphics like it, most high tech for the time.

https://terminals-wiki.org/wiki/index.php/DEC_VT240





Consider applying for YC's W25 batch! Applications are open till Nov 12.

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

Search: