https://github.com/stjohnjohnson/gifview
gifview is a tview that displays animated GIFs powered by pixelview
https://github.com/stjohnjohnson/gifview
gif golang pixelview tcell tui tview
Last synced: 3 months ago
JSON representation
gifview is a tview that displays animated GIFs powered by pixelview
- Host: GitHub
- URL: https://github.com/stjohnjohnson/gifview
- Owner: stjohnjohnson
- License: apache-2.0
- Created: 2020-03-01T01:38:55.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-03-02T03:47:05.000Z (over 5 years ago)
- Last Synced: 2024-12-08T13:46:12.930Z (11 months ago)
- Topics: gif, golang, pixelview, tcell, tui, tview
- Language: Go
- Homepage: https://pkg.go.dev/github.com/stjohnjohnson/gifview
- Size: 48.8 KB
- Stars: 5
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gifview
[](https://goreportcard.com/report/github.com/stjohnjohnson/gifview)
[](https://pkg.go.dev/github.com/stjohnjohnson/gifview?tab=doc)
Animated GIFs for TView-based TUIs (powered by pixelview)

## Usage
There are two ways to create a new GifView:
```go
// From an existing gif.GIF object
gifImg := &gif.GIF{}
img, err := gifview.FromImage(gifImg)
// From a file path
gifPath := "images/dancing-baby.gif"
img, err := gifview.FromImagePath(gifPath)
```
Once you have one or more GifViews, they will animate whenever the application re-draws. You can force that to happen on a regular basis by using the `Animate` function.
```go
app := tview.NewApplication()
go gifview.Animate(app)
```
## Based on
* [tview](https://github.com/rivo/tview)
* [pixelview](https://github.com/Omnikron13/pixelview)
* [tcell](https://github.com/gdamore/tcell)