All Projects β†’ m-j-w β†’ Terminalgraphics.jl

m-j-w / Terminalgraphics.jl

Licence: other
True graphics for your Julia REPL

Programming Languages

julia
2034 projects

Projects that are alternatives of or similar to Terminalgraphics.jl

Pqiv
Powerful image viewer with minimal UI
Stars: ✭ 177 (+941.18%)
Mutual labels:  graphics, image-viewer
Chafa
πŸ“ΊπŸ—Ώ Terminal graphics for the 21st century.
Stars: ✭ 774 (+4452.94%)
Mutual labels:  graphics, image-viewer
Ronin
Experimental Graphics Terminal
Stars: ✭ 1,065 (+6164.71%)
Mutual labels:  graphics, repl
Simplelightbox
Touch-friendly image lightbox for mobile and desktop
Stars: ✭ 744 (+4276.47%)
Mutual labels:  image-viewer
Rendy
State of the art "build your own engine" kit powered by gfx-hal
Stars: ✭ 750 (+4311.76%)
Mutual labels:  graphics
Macsvg
macSVG - An open-source macOS app for designing HTML5 SVG (Scalable Vector Graphics) art and animation with a WebKit web view ➀➀➀
Stars: ✭ 789 (+4541.18%)
Mutual labels:  graphics
Bonzomatic
Live shader coding tool and Shader Showdown workhorse
Stars: ✭ 829 (+4776.47%)
Mutual labels:  graphics
Photobox
A lightweight CSS3 image viewer that is pretty to look and and easy to use
Stars: ✭ 735 (+4223.53%)
Mutual labels:  image-viewer
Pcx
Point cloud importer & renderer for Unity
Stars: ✭ 806 (+4641.18%)
Mutual labels:  graphics
Elm Platform
Bundle of all core development tools for Elm
Stars: ✭ 775 (+4458.82%)
Mutual labels:  repl
Spotlight
Web's most easy to integrate lightbox gallery library. Super-lightweight, outstanding performance, no dependencies.
Stars: ✭ 799 (+4600%)
Mutual labels:  image-viewer
Feh
a fast and light image viewer
Stars: ✭ 766 (+4405.88%)
Mutual labels:  image-viewer
Raylib
A simple and easy-to-use library to enjoy videogames programming
Stars: ✭ 8,169 (+47952.94%)
Mutual labels:  graphics
Makie.jl
High level plotting on the GPU.
Stars: ✭ 791 (+4552.94%)
Mutual labels:  graphics
Littlewolf
A tiny software graphics and game engine
Stars: ✭ 749 (+4305.88%)
Mutual labels:  graphics
Rappel
A linux-based assembly REPL for x86, amd64, armv7, and armv8
Stars: ✭ 818 (+4711.76%)
Mutual labels:  repl
React Native Canvas
A Canvas component for React Native
Stars: ✭ 736 (+4229.41%)
Mutual labels:  graphics
Inspector
A drop-anywhere C++ REPL
Stars: ✭ 767 (+4411.76%)
Mutual labels:  repl
Opengraphic
Graphic Engine & Game Engine lists
Stars: ✭ 772 (+4441.18%)
Mutual labels:  graphics
Vim Quickrepl
The Simplest Faster way to open your REPL for filetypes.
Stars: ✭ 17 (+0%)
Mutual labels:  repl

TerminalGraphics – True graphics for your Julia REPL!

A proof of concept! β€” for which a picture says more than a thousand words...

First Example of TerminalGraphics with MLTerm

Second Example of TerminalGraphics with MLTerm

Some terminal emulators support the DEC Sixel raster graphics format, and 'libsixel' provides a convenient and fast way to generate the required terminal escape sequences. So, why not use this several decade old technology for modern technical programming tasks?

This library intends to provide support to print the most common types of graphics in your Sixel-enabled terminal emulator - without user interaction.

Note that quite a number of libraries and Julia packages provide similar support natively, if requested. This includes 'ImageMagick', 'GR', 'Matplotlib', 'Gnuplot' etc. However, 'TerminalGraphics' intends to relieve you from the burdon to figure this out by yourself, and tries to provide similar for other usecases - eventually.

Installation and Usage

  1. Use the Julia package manager to obtain 'TerminalGraphics'

    Pkg.clone("https://github.com/m-j-w/TerminalGraphics.jl")
    Pkg.build("TerminalGraphics")
    

    This should, by all means, download and install a recent version of 'libsixel', compile it and provide it for the Julia backend. If that doesn't work, then try to compile it and install it manually. The Pkg.build step should find it if in regular places.

  2. Use a Sixel-capable terminal emulator to host your Julia REPL. Note, that if you connect from remote, then the terminal emulator is the relevant piece of software regarding displaying graphics, not the remote host operating system.

Terminal Emulators with Sixel Support

Sixel support is not too common in terminal emulators. However, there are a few which should allow to use TerminalGraphis from every operating system:

  • Windows: Use MinTTY, which supports Sixel out-of-the-box. Also allows you to connect to a Julia session hosted in Bash-on-Windows, aka WSL.
  • Linux: Use MLTerm, which also supports Sixel graphics out-of-the-box. For xterm, rxvt etc. a rebuild from source and probably some patches are required. More information is found at (https://github.com/saitoha/libsixel/).
  • Mac: Sorry, no idea...

Hayaki Saito has also created quite a number of patches for other terminal emulators, such as 'rxvt'.

Julia Integration

TerminalGraphics implements a wrapper for 'libsixel', and an interface to the Julia multimedia displaying machinery. This way, images can be 'shown' automatically in the terminal. If necessary, the image data is converted to 8bit per color channel, and flipped to row-major. Also note that there is automatic detection of Plots, Cairo and Luxor. Thus even if loaded after 'TerminalGraphics', the proper functions will be injected. This is experimental and still somewhat error prone.

Caveats and Limitations

Sixel can typically only draw 256 colors. Thus, libsixel provides a number of algorithms to dither the original image. However, some images are not (yet) shown correctly.

Further directions

Some ideas for further development include automatic conversion of output from 'Plots' and 'Luxor'. For sure there are other neat or practical opportunities. Most notably, libsixel can also handle animated gifs...

Your contributions in this effort are highly welcome!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].