Skip to content

lusingander/lpx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LPX

Crate Status

Terminal Animated GIF Viewer 📽️

(Check out the Screenshots for more demos of how it works!)

About

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

Requirements

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.

Supported terminal emulators

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.

Inline Images Protocol (iTerm2)

*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.

Terminal graphics protocol (kitty)

Unsupported environments

  • Sixel graphics is not supported.
  • Terminal multiplexers (screen, tmux, Zellij, etc.) are not supported.
  • Windows is not supported.

Installation

$ cargo install --locked lpx
$ brew install lusingander/tap/lpx
$ paru -S lpx

Downloading binary

You can download pre-compiled binaries from releases.

Usage

After installation, run the following command:

$ lpx path/to/your/image.gif

Options

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

Keybindings

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

Screenshots

Show detailed information

Loop a specific range

Change playback speed

Inline mode

License

MIT