lsix
Display images in terminal
TLDR
List images in the current directory
List images in a specific directory
Display an image on the terminal
SYNOPSIS
lsix [OPTIONS] [FILES...]
PARAMETERS
--width=N, -w N
Sets the maximum width for the displayed thumbnails in pixels.
--height=N, -h N
Sets the maximum height for the displayed thumbnails in pixels.
--zoom=N, -z N
Sets a zoom factor for images (e.g., `0.5` for half size, `2.0` for double size).
--recursive, -R
Lists images in subdirectories recursively.
--long, -l
Displays images with additional file information (like `ls -l`), including original dimensions and file size.
--size, -s
Displays the original image dimensions (widthxheight) alongside the thumbnail.
--all, -a
Shows hidden files (those starting with '.').
--force, -f
Forces sixel output even if the terminal does not advertise sixel support. Use with caution as it may produce garbled output.
--single, -1
Displays one image per line, preventing multiple images from appearing side-by-side.
--version, -v
Displays the lsix version information and exits.
--help, -H
Displays the help message and exits.
FILES...
One or more image file paths or directories to process. If no files are specified, it processes the current directory.
DESCRIPTION
lsix is a powerful non-standard command-line tool that enables users to display image thumbnails directly within their terminal emulator. Unlike traditional file listing commands, lsix leverages sixel graphics technology to render visual previews of image files, making it incredibly useful for quickly browsing directories containing many images without needing to open a dedicated GUI image viewer.
It functions by using ImageMagick's `convert` utility to resize and transform image files into the sixel format, which is then printed to the terminal. For lsix to work, your terminal emulator must support sixel graphics (e.g., xterm with sixel patches, mlterm, wezterm, or kitty with appropriate setup). It's an excellent utility for system administrators, developers, or anyone working in a terminal-centric environment who needs quick visual feedback on image content.
CAVEATS
lsix is not a standard Linux utility and requires manual installation. Its core functionality depends on two key prerequisites:
1. A terminal emulator that supports sixel graphics (e.g., xterm compiled with sixel support, mlterm, wezterm, Konsole, or kitty with appropriate `imgcat` setup). Without sixel support, lsix will only output plain text or nothing at all.
2. The ImageMagick suite must be installed, specifically the `convert` command, which lsix uses for image processing.
Performance can be an issue when displaying a large number of high-resolution images, as each image needs to be processed and converted to sixel. Output over SSH may also be problematic if the `TERM` environment variable is not correctly configured or if the SSH client does not properly forward sixel capabilities.
INSTALLATION
To use lsix, you typically need to clone its Git repository (e.g., from github.com/hackerb9/lsix), make the script executable, and place it in a directory included in your system's PATH environment variable. No complex compilation is usually required as it is a shell script, making installation straightforward for most users.
SIXEL GRAPHICS EXPLAINED
Sixel is a bitmap graphics format originally introduced by DEC (Digital Equipment Corporation) in the late 1970s. It allows for image data to be encoded as a sequence of ASCII characters, which a compatible terminal can then interpret and render as pixels on the screen. lsix uses this mechanism to draw images directly within the text area of the terminal, providing a unique visual experience.
HISTORY
The lsix command was primarily developed by Hisham H. Muhammad (@hackerb9) and emerged as a popular tool to bring visual image previews to the command line. It capitalizes on the resurgence of sixel graphics, a bitmap display format from the late 1970s and early 80s, which has seen renewed interest with modern, feature-rich terminal emulators. Its development highlights an ongoing effort within the open-source community to enhance the terminal experience, bridging the gap between graphical and text-based environments. lsix quickly became a go-to solution for terminal users needing efficient image browsing without leaving their command-line interface.