https://github.com/nota30/gifenc
A minimal and simple to use GIF encoder
https://github.com/nota30/gifenc
gif-encoder go golang
Last synced: 10 months ago
JSON representation
A minimal and simple to use GIF encoder
- Host: GitHub
- URL: https://github.com/nota30/gifenc
- Owner: Nota30
- License: mit
- Created: 2024-02-10T09:49:15.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-12T03:15:56.000Z (over 2 years ago)
- Last Synced: 2025-01-20T07:33:29.002Z (over 1 year ago)
- Topics: gif-encoder, go, golang
- Language: Go
- Homepage:
- Size: 1.24 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Gifenc
A Golang based GIF encoder/decoder
- Convert GIFs to images and images to GIFs
## Prerequisites
- [Go](https://go.dev/)
## Quick Start
Import the `gifenc` package first.
```go
package main
import (
"github.com/Nota30/gifenc"
)
func main() {
gify := gifenc.Config{}
// Decode
var gif *gif.GIF // Provide a gif
imgs, err := gify.Decode(gif)
if err != nil {
println(err)
}
// Encode
var images []image.Image // Provide an array of images
encoded, err := gify.Encode(images)
if err != nil {
println(err)
}
}
```
You can view examples in the `test/test.go` file.
## Issues
- This package uses Floyd–Steinberg dithering so the GIF result might not be what you expected.
- Maybe adding other dithering algorithms at a later release?