← All 21 apps

CandyGifView

📽 CandyGifView

Terminal GIF and .ansi-art viewer

inspired by namzug16/gifterm gif ansi-art viewer cli

CandyGifView code coverage

The terminal GIF + .ansi-art viewer: point it at a file and it sizes to your viewport, decodes via sugar-animation, and plays the animation in the alternate screen — full-cell 24-bit blocks or a luminance-density ramp, toggled live. This is the command that used to ship as bin/sugar-animation, split into its own app package.

Install

composer require sugarcraft/candy-gifview

Quickstart

candy-gifview my-animation.gif         # solid 24-bit blocks (default)
candy-gifview my-animation.gif density # luminance-density ramp

# keys while playing
#   Space   pause / resume
#   Left/Right  step frames
#   d       toggle solid <-> density
#   q / Esc quit

What's in the box

One-command viewercandy-gifview file.gif — no flags to learn; an optional second argument picks the render preset.
Viewport-sizedQueries the TTY size behind a core stream_isatty gate (descriptor 1, never the cast resource id) and reserves a row, so output never overflows the screen; off a TTY it falls back to a 60×24 cell grid.
Alternate screenRuns the sugar-animation Player inside a sugar-core Program with useAltScreen, so your shell buffer is untouched when you quit.
Live preset toggled swaps solid blocks ↔ the ` .:-=+*#%@` density ramp without losing your frame position.
Helpable--help / -h print the localized usage line and exit 0; missing or unreadable files exit non-zero with the decoder's error on stderr.
Testable coreAll argument handling lives in SugarCraft\GifView\Cli — the bin is a two-line shim, and a closure seam lets tests drive the wired Player without a terminal.
LocalizedUsage and autoload-probe messages ship in sixteen locales via the sugar-core i18n lookup.

Source & demos

Try the quickstart →

API

ClassMethodDescription
Climain(argv, stdout, stderr, play)Parse args, decode, wire the Player, run the Program; returns the exit code
CliviewportCells()TTY-sized cell grid (cols, rows-1) behind a stream_isatty gate, 60×24 fallback
Langt(key, params)Localized CLI messages (namespace gifview)

Demos.

VHS-recorded GIFs of every example shipped with the app. Regenerated automatically on every push that touches the source.

View

View

Synthetic gif played through the viewer CLI, both presets.