Terminal Animated GIF Viewer 📽️
(Check out the Screenshots for more demos of how it works!)
LPX is a tool for displaying GIF animations directly in the terminal.
It features the following capabilities:
- Image rendering using image display protocols (iTerm2, kitty)
- Interactive controls such as play, pause, and frame-by-frame stepping
- Loop playback of a selected range
- Flexible display modes, including full-screen and inline viewing
Warning
This tool requires a terminal emulator that supports following image protocols. It will not work in environments without these protocols, and there is no text-based fallback.
The following image protocols are supported:
Confirmed working terminal emulators are listed below. Other emulators supporting these protocols may also work, though they have not been explicitly tested.
*1 Requires the terminal.integrated.enableImages setting to be enabled.
*2 Any terminal emulator using xterm.js (like the VSCode terminal) may work if the image display feature is enabled.
- Sixel graphics is not supported.
- Terminal multiplexers (screen, tmux, Zellij, etc.) are not supported.
- Windows is not supported.
$ cargo install --locked lpx
$ brew install lusingander/tap/lpx
$ paru -S lpx
You can download pre-compiled binaries from releases.
After installation, run the following command:
$ lpx path/to/your/image.gif
LPX - Terminal Animated GIF Viewer 📽️
Usage: lpx [OPTIONS] <FILE>
Arguments:
<FILE> Path to the image file
Options:
-p, --protocol <TYPE> Select the graphics protocol [default: auto] [possible values: auto, iterm, kitty]
-n, --frame-step <N> Number of frames to skip per step action [default: 10]
-w, --max-width <WIDTH> Limit the maximum width of the UI
-i, --inline <HEIGHT> Enable inline mode with the specified height in rows
-h, --help Print help
-V, --version Print version
| Key | Description |
|---|---|
| q Esc Ctrl-C | Quit application |
| Space | Play / Pause |
| h / l or ← / → | Move to previous / next frame |
| H / L or Shift + ← / → | Move backward / forward by frame step count |
| 0 - 9 | Jump to percentage (0% to 90%) |
| j / k or ↓ / ↑ | Decrease / Increase playback speed |
| [ / ] | Set loop start / end point |
| C | Clear loop range |
| d | Toggle detailed information display |
MIT