Raster graphics in xterm?
Asked Answered
B

4

23

No, not ASCII graphics, see the screenshot here:

http://en.wikipedia.org/wiki/W3m

image

How is that even possible?

I checked the source and it only prints character sequences. However, I am unable to find any reference to graphic drawing or image embedding escape sequences in xterm documentation or elsewhere.

w3m also seems to be the only software doing this.

There are vector graphics in Tektronix emulation, but this is done in VT mode.

Maybe I am looking for the wrong thing?

Any idea?

Busty answered 22/1, 2010 at 1:30 Comment(1)
Here's one method, I don't know if it's what w3m uses: pippin.gimp.org/tvBrahui
P
14

It's a cheat.

Note that this feature works only in "supported terminals" -- and by that it meant xterm, and rendering directly on the xterm window via xv.

Or not! Just checked the sources, the file that interests us is here. It's still a hack -- via X11 and GTK!

Prussia answered 22/1, 2010 at 1:34 Comment(5)
That page is awful, it is 1995 again! :) While w3m has an option to display through xv I don't think the two are related. I don't even have an xv package.Busty
@jbcreix : yeah, had the same '95 feeling ;> -- From the w3m page - Q : How do I change the default image viewer? A : By default w3m uses xv to view images. If you want to change it into, let's say, 'display', add the following line to ~/.mailcap or /etc/mailcap. Check your viewer!Prussia
@jbcreix : "use the source Luke" -- found it ;>Prussia
Oh, it was writing its own "w3m image protocol". That's what you get reading a file with no comments. Interesting, but in the end it's just a hack. :(Busty
This is the only answer which addresses the question.Cooperate
A
10

There is MLTerm, which supports Sixel format (not ReGis commands). It's available for both Linux and Windows.

Otherwise, according to man xterm on Ubuntu 12.04, xterm supports Tektronix graphics, which (the man page does tell) use ReGIS commands or Sixel bitmap format, depending on compilation options (I believe it's Sixel for the XTerm in the Ubuntu package repository).

One thing to know, is that ReGIS is an instruction set, while Sixel is a bitmap format.

As a side note, there exists a Python package to use Sixel aware terminal emulators: PySixel.

I'm interested in the topic too, and may update this answer in the future, with other relevant terminal emulators entries.

Ablaze answered 14/7, 2014 at 10:26 Comment(2)
As to xterm, apparently one should run it with xterm -ti 340 to enable Sixel rendering. One can then test it e.g. on a sample "map8.six" image from libsixel repository. Worked For Me™! (There are other sample images reportedly at invisible-island.net/temp/SIXEL.tgz)Eradicate
The Tektronix emulation is unrelated to the ReGIS and Sixel support; the manual page doesn't imply that it is related.Cooperate
G
4

Higher-end models of Dec VT terminals support ReGis and Sixel graphics commands. If the xterm emulation is good enough, maybe that's how it was done?

Goines answered 22/1, 2010 at 2:13 Comment(2)
xterm doesn't seem to support these modes. At least all references I found were to them not working.Busty
It's not a matter of "good enough", but what is targeted: at the point in time when this answer was suggested, the xterm manual was clear that it emulated vt220 (and ReGIS is not a feature of vt220). On the other hand, this answer does not address the question.Cooperate
L
2

Xterm supports the sixel and ReGIS protocols which allow rendering graphics directly in the terminal using escape sequences. However, Unicode interferes with 8 bit escape sequences, so you may need to convert them to 7bit sequences.

https://en.wikipedia.org/wiki/Sixel

https://en.wikipedia.org/wiki/ReGIS

Lightning answered 21/4, 2017 at 22:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.