gifview
View GIF images
SYNOPSIS
gifview [options] <giffile>...
PARAMETERS
-a, --animate
Animate the GIF if it contains multiple frames. This is the default behavior if the GIF is animated.
-d <delay>, --delay <delay>
Set the frame delay in milliseconds (ms) for animation playback. Overrides the GIF's internal delay.
-w <width>, --width <width>
Set the output width in characters. The image will be scaled to fit this width.
-h <height>, --height <height>
Set the output height in characters. The image will be scaled to fit this height.
-i, --interlaced
Display interlaced GIFs properly, rendering them gradually as data arrives. (Typically default behavior).
-s <speed>, --speed <speed>
Set the playback speed multiplier. For example, 0.5 for half speed, 2.0 for double speed.
-t, --time
Show elapsed time and current frame number during animation playback.
-v, --version
Display version information and exit.
-X <x-offset>, --x-offset <x-offset>
Set the X-offset (horizontal position) for the display in characters from the left edge.
-Y <y-offset>, --y-offset <y-offset>
Set the Y-offset (vertical position) for the display in characters from the top edge.
-f <frame>, --frame <frame>
Start animation playback from a specific frame number (0-indexed).
-F, --foreground
Run gifview in the foreground; do not fork to the background after starting.
--loop <count>
Loop the animation <count> times. Use 0 for indefinite looping.
--scale
Scale the image to fit the current terminal window dimensions.
--fit-width
Scale the image to fit the current terminal width, maintaining aspect ratio.
--fit-height
Scale the image to fit the current terminal height, maintaining aspect ratio.
--unscaled
Do not scale the image; display it at its original pixel dimensions, potentially clipping.
--crop <WxH+X+Y>
Crop the image to the specified width (W), height (H), X-offset (X), and Y-offset (Y).
--optimize <level>
Optimize the output for better rendering, potentially reducing colors or simplifying character sets. Level 0 for no optimization.
--no-optimize
Disable any output optimization, displaying the image as-is.
--display <device>
Specify the display device to use (e.g., text or stdout for ASCII output).
--background <color>
Set the background color for the displayed image. Color can be a name or hex value.
--char-set <set>
Use a specific character set for rendering (e.g., ascii for basic characters, unicode for richer rendering).
--font-size <size>
Adjust internal font size calculations, which can affect image scaling and aspect ratio in some terminals.
--help
Display a help message with available options and exit.
DESCRIPTION
gifview is a lightweight command-line utility designed for displaying animated GIF images directly within a terminal emulator. Unlike traditional GUI-based image viewers, gifview renders GIFs using ASCII art or suitable Unicode characters, allowing users to quickly preview animations without leaving the command line. It supports various playback options, including speed control, frame-by-frame navigation, and looping. Ideal for server environments, SSH sessions, or scripting where a graphical display is unavailable or undesirable, gifview provides a simple yet effective way to interact with GIF files. Its ability to play animations directly in a text-based environment makes it a unique and valuable tool for developers, system administrators, and anyone working primarily within the terminal.
CAVEATS
Performance can vary significantly based on the terminal emulator's capabilities and the complexity of the GIF. Color accuracy may be limited by terminal color support (e.g., 256 colors vs. true color). Large or high-resolution GIFs might render slowly or consume significant CPU resources. Optimal viewing often requires a terminal with good Unicode support and a monospace font. Rendering quality can be inconsistent across different terminal emulators.
INTERACTIVE CONTROLS
When gifview is running in animation mode, the following keys provide interactive control:
Spacebar: Pause/Resume animation.
Backspace: Go back to the previous frame.
Enter: Advance to the next frame.
q: Quit the viewer.
s: Toggle `s`peed display.
t: Toggle `t`ime display.
d: Increase `d`elay (slow down).
D: Decrease `d`elay (speed up).
h: Show/hide `h`elp (in some versions).
These controls allow for dynamic interaction with the GIF during playback, enhancing its utility beyond simple viewing.
HISTORY
Part of the giflib development project, gifview has emerged as a utility for command-line users needing to quickly inspect animated GIFs without relying on a graphical environment. Its existence underscores the ongoing demand for rich media capabilities within text-based interfaces, making it particularly useful for remote server administration, scripting, and minimalist computing setups.