Terminal GIF and .ansi-art viewer
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.
composer require sugarcraft/candy-gifview
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
candy-gifview file.gif — no flags to learn; an optional second argument picks the render preset.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.Player inside a sugar-core Program with useAltScreen, so your shell buffer is untouched when you quit.d swaps solid blocks ↔ the ` .:-=+*#%@` density ramp without losing your frame position.--help / -h print the localized usage line and exit 0; missing or unreadable files exit non-zero with the decoder's error on stderr.SugarCraft\GifView\Cli — the bin is a two-line shim, and a closure seam lets tests drive the wired Player without a terminal.| Class | Method | Description |
|---|---|---|
| Cli | main(argv, stdout, stderr, play) | Parse args, decode, wire the Player, run the Program; returns the exit code |
| Cli | viewportCells() | TTY-sized cell grid (cols, rows-1) behind a stream_isatty gate, 60×24 fallback |
| Lang | t(key, params) | Localized CLI messages (namespace gifview) |
VHS-recorded GIFs of every example shipped with the app. Regenerated automatically on every push that touches the source.