Display Images in a Linux Terminal with lsix – Install and Use Guide
Learn how to install the lsix utility, enable Sixel support in Xterm, and effortlessly show pictures directly in your Linux terminal using simple commands and configuration steps.
Linux terminals are traditionally text‑only, but with the lsix tool you can render images right inside the terminal.
What is lsix?
lsixis a Bash script that displays pictures using the Sixel graphics protocol. Its key features are:
Automatically adapts image colors to the terminal's foreground and background.
Works locally and over SSH.
Supports image formats such as PNG, JPEG, SVG, EPS, PDF, XCF, etc.
Implemented in Bash, so it runs on most Linux distributions.
Installing lsix
lsix relies on ImageMagick. Install ImageMagick first:
sudo pacman -S imagemagick sudo apt-get install imagemagickDownload the lsix source and place the script in a directory that is in $PATH (e.g., /usr/local/bin), then make it executable:
wget https://github.com/hackerb9/lsix/archive/master.zip unzip lsix-master.zip sudo cp lsix-master/lsix /usr/local/bin/ sudo chmod +x /usr/local/bin/lsixEnabling Sixel support in Xterm
lsix requires a terminal that understands the Sixel format. Start Xterm in vt340 emulation mode: xterm -ti vt340 To make Sixel the default, edit .Xresources (create it if missing) and add: xterm*decTerminalID : vt340 Save the file (press ESC then type :wq ) and merge the changes: xrdb -merge .Xresources After this, any new Xterm window will have Sixel enabled.
Using lsix
Display a specific image (e.g., logo.jpg) with: lsix logo.jpg Show all images in the current directory: lsix Use wildcards to filter, for example all JPEG files: lsix *.jpg The tool works the same way over SSH; a separate Xterm window will pop up to render the graphics.
Liangxu Linux
Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
