imgcat
Display images directly in terminal
TLDR
Display an image on the command-line
SYNOPSIS
imgcat [-1] [-a] [-c] [-g] [-h] [-t] [-x width] [-X max-width] [-y height] [-Y max-height] [file ...]
PARAMETERS
-1
Use smallest bounding box; ignores aspect ratio
-a
Adopt invoker's working directory
-c
Process only first file
-g
Print debug geometry info
-h
Show help and exit
-t
Print test pattern to verify support
-x width
Suggested display width (cells)
-X max-width
Maximum display width (cells)
-y height
Suggested display height (cells)
-Y max-height
Maximum display height (cells)
DESCRIPTION
imgcat is a command-line tool that displays images directly inline in supported terminal emulators using the iTerm2 image protocol. This protocol embeds image data via ANSI escape sequences, allowing images to appear seamlessly within terminal text output without opening external viewers.
Ideal for developers, sysadmins, and CLI enthusiasts on Linux, it works in terminals like Kitty, WezTerm, and Foot that support the protocol. Run imgcat photo.jpg to preview images in scripts, tmux panes, SSH sessions, or file explorers like ranger/fzf.
Features include resizing, aspect ratio control, and multi-file support. It preserves transparency and handles common formats like PNG, JPEG, GIF, and WebP. Debug options help troubleshoot protocol compatibility. While primarily from iTerm2, Linux ports (e.g., Go implementation) make it portable across Unix-like systems.
CAVEATS
Requires terminal with iTerm2 image protocol support (e.g., not standard xterm/gnome-terminal). Images may flicker or fail in SSH without config. Large files can slow rendering.
INSTALLATION
Linux: pip install iterm2-tools or go install github.com/whereswaldon/imgcat@latest. Check distro repos or tmux plugins.
SUPPORTED FORMATS
PNG, JPEG, GIF, WebP, BMP; auto-detects MIME types.
EXAMPLE
imgcat -x 80 image.png resizes to 80 cells wide.
imgcat *.jpg shows all JPEGs sequentially.
HISTORY
Developed by George Nachman for iTerm2 (macOS) around 2014 as part of shell integration tools. Protocol adopted by Linux terminals like Kitty (2018+), WezTerm (2020+). Cross-platform ports in Go/Python emerged for broader Unix use.


