7 ms·
Show HN: GNUplot with sixel – Mix images, ANSI colors and plots
- enriquto 8y agoprediction: in a few weeks somebody will rediscover the existence of tektronix emulation on xterm and the community will go crazy about it
- tyingq 8y agoI've played with it. Cool, but it is monochrome and font challenged. Neat for projecting a line map or similar for a retro-futurey look. Some 3270 terminals also support vector graphics. I don't remember if x3270 implemented them.
- rbanffy 8y agoI saw some impressive renderings on an IBM 3279. Sadly, it was never on my desk. And you'd have to translate the text from ASCII to EBCDIC.
- mindcrime 8y agoThat's not necessarily a bad thing though. Sometimes it's good to revisit some (seemingly) "forgotten" technologies which still have a lot of potential.
- enriquto 8y ago> That's not necessarily a bad thing though. I did not say it ironically! Tektronix is super-cool! It could be could be realistically rendered as sgv, and easily extended to add colors and stuff.
- mangecoeur 8y ago... and then proceed to re-invent VNC and RDP from first principles
- ChuckMcM 8y agoI was going to say reinvent X11 and then X terminals but the same applies.
- danmg 8y agomlterm's emulation of it is better.
- imhoguy 8y agohttps://github.com/saitoha/xserver-SIXEL https://github.com/saitoha/xserver-SIXEL I haven't tried that but issues tell that even mouse works with Firefox in terminal.
- NikkiA 8y agoI'm pretty sure I saw a terminal emulator with ReGIS emulation out there, I'm surprised that's not become the fad.
- daleroberts 8y agoFor Matplotlib, checkout this: https://github.com/daleroberts/itermplot https://github.com/daleroberts/itermplot
- saagarjha 8y agon.b. this only works in iTerm.
- jpalomaki 8y agoWikipedia article for sixel: https://en.m.wikipedia.org/wiki/Sixel https://en.m.wikipedia.org/wiki/Sixel
- sprash 8y agoThere seems to be desperate demand for graphics output in terminals. Sixels are a rather crude method dating from a time where terminals were optimized for low bandwidth serial connections and very constrained resources in the device that actually renders the content. We have 3D graphic cards now! This is why right now I'm working on a terminal emulator that implements escape codes that allows a subset of "byte compiled" OpenGL commands to run directly in the terminal window. You now can render a complex 3D scene just by cat'ing a file without any boiler plate code. I think there are many potential use cases for this. It allows for example remote graphics accelerated applications running on another machine via ssh. Once all the textures are uploaded to the GPU RAM the bandwidth required for the display commands is rather low even for interactive games.
- fxfan 8y agoCan you, github.com/jwilm, github.com/kovidgoyal et al get together and instead give us a better standard that all 3 of you implement? I am sorry but I won't use your terminal just for one feature, I can use a dedicated image viewer.
- sprash 8y agoSo far my version is just a crudely hacked together proof of concept on top of st I did as hobby. It just renders textured polygons without any shaders or more advanced stuff. Since this is my first OpenGL application ever it probably won't ever be released to the public. Somebody else with more experience should rather do it. A More advanced protocol like Valves Fossilize (https://github.com/ValveSoftware/Fossilize https://github.com/ValveSoftware/Fossilize) should be used for that which means I can throw away my code anyways at this point. However serialized graphics does not seem a project goal of either kitty or alacritty.
- ubercow13 8y agokitty has image support
- 8y ago
- thatsaguy 8y agoSixel is nice (and I use it all the time), but we do have better nowadays. iterm's image handling [1] is superior: it just encodes a modern and more efficient image format and sends it inbound to be decoded by the terminal. png was always at least equal if not more efficient than sixel at indexed colormaps. You can send jpegs for drastically more efficient true-color images. The "OSC1337" is not unique to iterm. mlterm also supports it, and I do remember a few others as well. You can use "ranger" to have image previews on a remote server without having to jump through hoops. [1] https://iterm2.com/documentation-images.html https://iterm2.com/documentation-images.html
- csdvrx 8y agosome terminal emulators support specific formats, but sixel strength is that I don't have to specifically install there emulators. Also, what if I use an OS where they don't work? (Windows 10?)
- thatsaguy 8y agoI have nothing against sixel, of course. But to put things in perspective, Sixel support by itself is not great. Definitely more supported than iterm's, but not universal. But when developing a new program that wants to output graphics to the terminal, OSC1337 is damn easy (you'll likely not need any new dependency or image handling routines), while for sixel you'd probably need libsixel or write your own encoder. As a developer, I vastly edge towards iterm's handling. (and to be honest, as a user as well. png encoding is faster too!)
- zimbatm 8y agoI would love it if all terminals agreed and implemented libsixel or another graphics format. libsixel is not supported by urxvt, alacritty, any VTE-based terminals as far as I know. iTerm2 has a custom base64-encodig based image format. there are even more: https://github.com/dylanaraps/neofetch/wiki/Image-Backends https://github.com/dylanaraps/neofetch/wiki/Image-Backends
- csdvrx 8y agoYou're right- more terminals need to implement a common format. I wish VTE and gnome-terminal would add sixel support
- rbanffy 8y agoWhile we are at it, let's add Tektronix 4010 graphics. With bright drawing beam and flash screen erase ;-) It'd be nice to have an agreed-upon simple standard for graphics in terminals. At the same time, Unicode 13 will add 2x3 graphics blocks from ITU T.100 and T.101 standards and a couple fonts will start supporting them from the start, so some lower resolution graphics will be immediately useful. I'm not sure if sixels will work under tmux or screen - someone mentioned they do, but I'm not sure how: the same problem we have with double-width and double-height (I wanted VTW to support them) and we all agreed it'd make tmux and screen essentially unusable.
- csdvrx 8y agosixel work under tmux and screen. Check my repository https://github.com/csdvrx https://github.com/csdvrx which is just cloned from existing branch by arakiken I added screenshots of gnuplot running under both tmux and screen, using msys2 and mlterm A vectorial support would be nice, but adding svg and a custom format like for iterm may better: Tektronix 4010 graphics is not as widely supported as sixel, and it may be a better start from scratch.
- vngzs 8y agoLink for the impatient: https://github.com/csdvrx/sixel-gnuplot/blob/8c3750a68ab6d1fc589cbe8edcc421019a385378/inside-tmux.jpg https://github.com/csdvrx/sixel-gnuplot/blob/8c3750a68ab6d1f...
- dima55 8y agoWhere are the sources? If you're releasing modified binaries, you're violating the gnuplot license.
- csdvrx 8y agoDo you understand that I just added one compile flag to debian official sources?
- dima55 8y agoClearly I did not understand this :) Is there any reason to not make this the default? I've never used this feature, but if you think it's generically useful, you can email the debian-science list with the suggestion. The maintainer is generally responsive.
- csdvrx 8y ago:) Already emailed, unfortunately it's too late to be included in the next release!
- black-tea 8y agoA github repo full of binaries? What is this?
- csdvrx 8y agoIt is just apt-get source gnuplot/testing ; cat debian/rules | sed -e 's/--with-gd/--with-gd --with-bitmap-terminals' > debian-rules ; dpkg-buildpackage . (or something approximately like that) But you are welcome to apt-get build-deb and do that by yourself if you don't trust my binaries or my memory :-)
- swiley 8y agoNOTE: this repo is only the patch for the debian packages, it appears gnuplot already supports sixel output if it's configured --with-bitmap-terminals
- csdvrx 8y agoYes that's indicated in the README. Nothing super complicated, I just wanted to show how it was super practical.
- iheartpotatoes 8y agoDoesn't really make sense to me that "cat <jpg>" should render the bitmap to the screen. 'cat' is a concatenation tool. 'cat'ing two JPEGs together isn't the same as 'cat'ing two text files. So why? Use another tool, don't break the idiom.
- csdvrx 8y agocat /etc/debian_version shows the file cat /etc/debian_version /etc/debian_version shows the file twice Shockingly, cat sixel1.six sixel2.six sixel3.six or img2sixel file1.jpg file2.jpg file3.jpg works in the exact same way: cf https://github.com/csdvrx/sixel-testsuite/blob/master/3-sixels.jpg https://github.com/csdvrx/sixel-testsuite/blob/master/3-sixe... Simply screenshot and edit the result when you are done. But if you want to create another tool, for example to trim white boarders and concatenate, by all means please do! Follow the example of https://github.com/hackerb9/lsix https://github.com/hackerb9/lsix who wrote a great tool!